コンテンツへスキップ
サインイン
APIリファレンス
リソース

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.

API Key Custom Roleモデル

プロパティ

  • 名前
    _id
    タイプ
    Object ID
    説明

    ID of this object

  • 名前
    createdAt
    タイプ
    Date
    説明

    Date and Time when the object was created.

  • 名前
    updatedAt
    タイプ
    Date
    説明

    Date and Time when the object was updated.

  • 名前
    project
    タイプ
    Project
    説明

    Relation to Project Resource in which this object belongs

  • 名前
    projectId
    タイプ
    Object ID 必須
    説明

    ID of your OneUptime Project in which this object belongs

  • 名前
    apiKey
    タイプ
    API Key
    説明

    The API key given the role.

  • 名前
    apiKeyId
    タイプ
    Object ID 必須
    説明

    ID of the API key given the role.

  • 名前
    customRole
    タイプ
    Custom Role
    説明

    The custom role given to the API key.

  • 名前
    customRoleId
    タイプ
    Object ID 必須
    説明

    ID of the custom role given to the API key.

  • 名前
    createdByUser
    タイプ
    User
    説明

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

  • 名前
    createdByUserId
    タイプ
    Object ID
    説明

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

GET または POST
/api/api-key-custom-role/get-list

一覧

このエンドポイントを使用すると、すべてのAPI Key Custom Roleのページ分割されたリストを取得できます。デフォルトでは、ページごとに最大10件のAPI Key Custom Roleが表示されます。

オプションのクエリパラメータ

  • Limit
    limit
    タイプ
    number
    説明
    取得するオブジェクトの数。デフォルトは10で、この数を最大100まで増やすことができます
  • Skip
    skip
    タイプ
    number
    説明
    スキップするオブジェクトの数。これはページネーションで便利です

オプションのリクエストボディ

Listリクエスト

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

レスポンス

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "75130bac-fb6b-4de8-b527-e3a9ec725db5",
            "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": "345bd076-63f7-4f44-9fc7-1a8964b74862",
            "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": "b5c52970-6138-47c2-8108-f6d3d28b6218",
            "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 または POST
/api/api-key-custom-role/:id/get-item

IDで項目を取得

このエンドポイントを使用すると、IDでAPI Key Custom Roleを取得できます。

必須のクエリパラメータ

  • ID
    id
    タイプ
    text
    説明
    オブジェクトのID

オプションのリクエストボディ

  • Select
    select
    タイプ
    select
    説明
    デフォルトでは、オブジェクトのIDのみが取得されます。より多くのフィールドを取得するには、それらを選択する必要があります。詳細については、 こちらでselectの方法をご確認ください。

Get Itemリクエスト

POST
/api/api-key-custom-role/:id/get-item
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "select": {
    "apiKeyId": true,
    "customRoleId": true,
    "projectId": true,
    "apiKey": true,
    "createdByUser": true
  }
}

レスポンス

{
    "_id": "75130bac-fb6b-4de8-b527-e3a9ec725db5",
    "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

カウント

このエンドポイントを使用すると、すべてのAPI Key Custom Roleのカウントを取得できます。

オプションのリクエストボディ

Countリクエスト

POST
/api/api-key-custom-role/count
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "query": {}
}

レスポンス

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

API Key Custom Roleを作成

このエンドポイントを使用すると、新しいオブジェクトを作成できます。

リクエストボディ

  • Data
    data
    タイプ
    JSON
    説明
    JSONとして作成するオブジェクト

Createリクエスト

POST
/api/api-key-custom-role
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "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"
  }
}

レスポンス

{
    "_id": "75130bac-fb6b-4de8-b527-e3a9ec725db5",
    "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

IDで更新

このエンドポイントを使用すると、IDでオブジェクトを更新できます。

リクエストボディ

  • Data
    data
    タイプ
    JSON
    説明
    JSONとして更新するオブジェクト

代替メソッド

PUTリクエストをサポートしないクライアントの場合、同じリクエストヘッダーとボディでPOSTまたはGETを使用できます:

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

Updateリクエスト

PUT
/api/api-key-custom-role/:id
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "data": {}
}

レスポンス

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

IDで削除

このエンドポイントを使用すると、IDでオブジェクトを削除できます。

代替メソッド

DELETEリクエストをサポートしないクライアントの場合、同じリクエストヘッダーとボディでPOSTまたはGETを使用できます:

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

Deleteリクエスト

DELETE
/api/api-key-custom-role/:id
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY

レスポンス

{}

権限

API Tokenでこのリソースを作成、更新、読み取り、または削除するには権限が必要です。リクエストを行う権限がない場合、レスポンスとして4xxステータスが送信されます。

読み取り権限

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.

作成権限

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.

更新権限

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.

削除権限

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.