Aller au contenu
Se connecter
Référence de l'API
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.

Le modèle API Key Custom Role

Propriétés

  • Nom
    _id
    Type
    Object ID
    Description

    ID of this object

  • Nom
    createdAt
    Type
    Date
    Description

    Date and Time when the object was created.

  • Nom
    updatedAt
    Type
    Date
    Description

    Date and Time when the object was updated.

  • Nom
    project
    Type
    Project
    Description

    Relation to Project Resource in which this object belongs

  • Nom
    projectId
    Type
    Object ID Obligatoire
    Description

    ID of your OneUptime Project in which this object belongs

  • Nom
    apiKey
    Type
    API Key
    Description

    The API key given the role.

  • Nom
    apiKeyId
    Type
    Object ID Obligatoire
    Description

    ID of the API key given the role.

  • Nom
    customRole
    Type
    Custom Role
    Description

    The custom role given to the API key.

  • Nom
    customRoleId
    Type
    Object ID Obligatoire
    Description

    ID of the custom role given to the API key.

  • Nom
    createdByUser
    Type
    User
    Description

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

  • Nom
    createdByUserId
    Type
    Object ID
    Description

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

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

Liste

Ce point de terminaison vous permet de récupérer une liste paginée de tous vos API Key Custom Role. Par défaut, un maximum de dix API Key Custom Role sont affichés par page.

Paramètres de requête facultatifs

  • Limit
    limit
    Type
    number
    Description
    Nombre d'objets à récupérer. Par défaut 10, vous pouvez augmenter ce nombre jusqu'à 100
  • Skip
    skip
    Type
    number
    Description
    Nombre d'objets à ignorer. Cela peut être utile dans le cadre de la pagination

Corps de requête facultatif

Requête List

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

Réponse

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "b0397794-7af6-4332-8078-931c2acdfab5",
            "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": "171f4aa2-21f1-4cfb-8057-fe76a90ebc08",
            "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": "613c1b45-71fb-4ff8-a758-82f475d11a2e",
            "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 ou POST
/api/api-key-custom-role/:id/get-item

Obtenir un élément par ID

Ce point de terminaison vous permet de récupérer API Key Custom Role par ID.

Paramètres de requête obligatoires

  • ID
    id
    Type
    text
    Description
    ID de l'objet

Corps de requête facultatif

Requête Get Item

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

Réponse

{
    "_id": "b0397794-7af6-4332-8078-931c2acdfab5",
    "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

Comptage

Ce point de terminaison vous permet de récupérer le nombre total de tous vos API Key Custom Role.

Corps de requête facultatif

Requête Count

POST
/api/api-key-custom-role/count
En-têtes
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corps
{
  "query": {}
}

Réponse

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

Créer API Key Custom Role

Ce point de terminaison vous permet de créer un nouvel objet.

Corps de la requête

  • Data
    data
    Type
    JSON
    Description
    Objet à créer au format JSON

Requête Create

POST
/api/api-key-custom-role
En-têtes
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corps
{
  "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"
  }
}

Réponse

{
    "_id": "b0397794-7af6-4332-8078-931c2acdfab5",
    "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

Mettre à jour par ID

Ce point de terminaison vous permet de mettre à jour un objet par son ID.

Corps de la requête

  • Data
    data
    Type
    JSON
    Description
    Objet à mettre à jour au format JSON

Méthodes alternatives

Pour les clients qui ne prennent pas en charge les requêtes PUT, vous pouvez utiliser POST ou GET avec les mêmes en-têtes de requête et le même corps :

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

Requête Update

PUT
/api/api-key-custom-role/:id
En-têtes
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corps
{
  "data": {}
}

Réponse

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

Supprimer par ID

Ce point de terminaison vous permet de supprimer un objet par son ID.

Méthodes alternatives

Pour les clients qui ne prennent pas en charge les requêtes DELETE, vous pouvez utiliser POST ou GET avec les mêmes en-têtes de requête et le même corps :

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

Requête Delete

DELETE
/api/api-key-custom-role/:id
En-têtes
Content-Type: application/json
ApiKey: YOUR_API_KEY

Réponse

{}

Autorisations

Votre jeton API a besoin d'autorisations pour créer, mettre à jour, lire ou supprimer cette ressource. Si vous ne disposez pas des autorisations nécessaires pour effectuer une requête, un statut 4xx sera renvoyé en réponse.

Autorisations de lecture

Requises pour lire 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.

Autorisations de création

Requises pour créer 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.

Autorisations de mise à jour

Requises pour mettre à jour 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.

Autorisations de suppression

Requises pour supprimer 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.