Zum Inhalt springen
Anmelden
API-Referenz
Ressource

API Key Custom Role

The custom roles an API key is given. The key holds every permission of the role except those with the Owned scope: a key owns nothing.

Das API Key Custom Role-Modell

Eigenschaften

  • Name
    _id
    Typ
    Object ID
    Beschreibung

    ID of this object

  • Name
    createdAt
    Typ
    Date
    Beschreibung

    Date and Time when the object was created.

  • Name
    updatedAt
    Typ
    Date
    Beschreibung

    Date and Time when the object was updated.

  • Name
    project
    Typ
    Project
    Beschreibung

    Relation to Project Resource in which this object belongs

  • Name
    projectId
    Typ
    Object ID Erforderlich
    Beschreibung

    ID of your OneUptime Project in which this object belongs

  • Name
    apiKey
    Typ
    API Key
    Beschreibung

    The API key given the role.

  • Name
    apiKeyId
    Typ
    Object ID Erforderlich
    Beschreibung

    ID of the API key given the role.

  • Name
    customRole
    Typ
    Custom Role
    Beschreibung

    The custom role given to the API key.

  • Name
    customRoleId
    Typ
    Object ID Erforderlich
    Beschreibung

    ID of the custom role given to the API key.

  • Name
    createdByUser
    Typ
    User
    Beschreibung

    Relation to User who created this object (if this object was created by a User)

  • Name
    createdByUserId
    Typ
    Object ID
    Beschreibung

    User ID who created this object (if this object was created by a User)

GET oder POST
/api/api-key-custom-role/get-list

Liste

Mit diesem Endpunkt kannst du eine paginierte Liste aller deiner API Key Custom Role abrufen. Standardmäßig werden maximal zehn API Key Custom Role pro Seite angezeigt.

Optionale Abfrageparameter

  • Limit
    limit
    Typ
    number
    Beschreibung
    Anzahl der abzurufenden Objekte. Standardmäßig 10, du kannst diese Anzahl auf bis zu 100 erhöhen
  • Skip
    skip
    Typ
    number
    Beschreibung
    Anzahl der zu überspringenden Objekte. Dies kann bei der Paginierung nützlich sein

Optionaler Anfragetext

Listen-Anfrage

POST
/api/api-key-custom-role/get-list?skip=0&limit=10
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY
Text
{
  "select": {
    "apiKeyId": true,
    "customRoleId": true,
    "projectId": true,
    "apiKey": true,
    "createdByUser": true
  },
  "query": {},
  "sort": {
    "createdAt": -1
  }
}

Antwort

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "26e4d9ca-5142-44bb-a07c-ed0c8cca05cf",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        },
        {
            "_id": "57b116c9-926b-438b-80dc-ea7c6054a731",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        },
        {
            "_id": "2fa73119-c8c7-4676-b6df-ad56e0f0145c",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        }
    ]
}
GET oder POST
/api/api-key-custom-role/:id/get-item

Element nach ID abrufen

Mit diesem Endpunkt kannst du API Key Custom Role nach ID abrufen.

Erforderliche Abfrageparameter

  • ID
    id
    Typ
    text
    Beschreibung
    ID des Objekts

Optionaler Anfragetext

Get-Item-Anfrage

POST
/api/api-key-custom-role/:id/get-item
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY
Text
{
  "select": {
    "apiKeyId": true,
    "customRoleId": true,
    "projectId": true,
    "apiKey": true,
    "createdByUser": true
  }
}

Antwort

{
    "_id": "26e4d9ca-5142-44bb-a07c-ed0c8cca05cf",
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "createdByUser": "admin@company.com"
}
POST
/api/api-key-custom-role/count

Anzahl

Mit diesem Endpunkt kannst du die Anzahl aller deiner API Key Custom Role abrufen.

Optionaler Anfragetext

Anzahl-Anfrage

POST
/api/api-key-custom-role/count
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY
Text
{
  "query": {}
}

Antwort

{
    "count": 107
}
POST
/api/api-key-custom-role

API Key Custom Role erstellen

Mit diesem Endpunkt kannst du ein neues Objekt erstellen.

Anfragetext

  • Data
    data
    Typ
    JSON
    Beschreibung
    Zu erstellendes Objekt als JSON

Erstellungs-Anfrage

POST
/api/api-key-custom-role
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY
Text
{
  "data": {
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "customRole": "Incident Responder"
  }
}

Antwort

{
    "_id": "26e4d9ca-5142-44bb-a07c-ed0c8cca05cf",
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "createdByUser": "admin@company.com"
}
PUT
/api/api-key-custom-role/:id

Nach ID aktualisieren

Mit diesem Endpunkt kannst du ein Objekt nach seiner ID aktualisieren.

Anfragetext

  • Data
    data
    Typ
    JSON
    Beschreibung
    Zu aktualisierendes Objekt als JSON

Alternative Methoden

Für Clients, die keine PUT-Anfragen unterstützen, kannst du POST oder GET mit denselben Anfrage-Headern und Body verwenden:

POST /api/api-key-custom-role/:id/update-item

Aktualisierungs-Anfrage

PUT
/api/api-key-custom-role/:id
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY
Text
{
  "data": {}
}

Antwort

{}
DELETE
/api/api-key-custom-role/:id

Nach ID löschen

Mit diesem Endpunkt kannst du ein Objekt nach seiner ID löschen.

Alternative Methoden

Für Clients, die keine DELETE-Anfragen unterstützen, kannst du POST oder GET mit denselben Anfrage-Headern und Body verwenden:

POST /api/api-key-custom-role/:id/delete-item

Lösch-Anfrage

DELETE
/api/api-key-custom-role/:id
Header
Content-Type: application/json
ApiKey: YOUR_API_KEY

Antwort

{}

Berechtigungen

Dein API-Token benötigt Berechtigungen, um diese Ressource zu erstellen, zu aktualisieren, zu lesen oder zu löschen. Wenn du keine Berechtigungen für eine Anfrage hast, wird ein 4xx-Status als Antwort gesendet.

Leseberechtigungen

Erforderlich zum Lesen von API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • ReadProjectApiKey
    Read API Key
    This permission can read api keys of this project.

Erstellungsberechtigungen

Erforderlich zum Erstellen von API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.

Aktualisierungsberechtigungen

Erforderlich zum Aktualisieren von API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.

Löschberechtigungen

Erforderlich zum Löschen von API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • DeleteProjectApiKey
    Delete API Key
    This permission can delete api keys of this project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.