Skip to content
View as Markdown

AdminService

This is the API for product facing admin features. Not internal admin.

CreateKey

Creates an API key or SDK key for the authenticated user.

Request: bitdrift.public.unary.admin.v1.CreateKeyRequest

Response: bitdrift.public.unary.admin.v1.CreateKeyResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/CreateKey \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Workflow",
  "sdk_key": {
    "app_id_postfix": "com.example.app",
    "bundle_id_regex": "com.example.*"
  }
}'

Example Response

JSON
{
  "key": {
    "created_at": "2024-01-15T09:30:00Z",
    "expires_at": "2024-01-15T09:30:00Z",
    "id": 1,
    "name": "My Workflow",
    "revoked": false,
    "sdk_key": {
      "app_id_postfix": "com.example.app",
      "bundle_id_regex": "com.example.*",
      "key": "example-key"
    }
  }
}

DeleteConnector

Delete a connector for the calling account.

Request: bitdrift.public.unary.admin.v1.DeleteConnectorRequest

Response: bitdrift.public.unary.admin.v1.DeleteConnectorResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/DeleteConnector \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example-connector"
}'

Example Response

JSON
{}

GetConnectors

Gets all connectors for the calling account.

Request: bitdrift.public.unary.admin.v1.GetConnectorsRequest

Response: bitdrift.public.unary.admin.v1.GetConnectorsResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/GetConnectors \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{}'

Example Response

JSON
{
  "connectors": [
    {
      "cloudwatch_connector_config": {
        "region": "us-east-1",
        "role_arn": "arn:aws:iam::123456789012:role/CloudWatchConnectorRole"
      },
      "name": "example-connector"
    }
  ]
}

GetKeys

Lists the API and SDK keys available to the authenticated user.

Request: bitdrift.public.unary.admin.v1.GetKeysRequest

Response: bitdrift.public.unary.admin.v1.GetKeysResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/GetKeys \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{}'

Example Response

JSON
{
  "keys": [
    {
      "created_at": "2024-01-15T09:30:00Z",
      "expires_at": "2024-01-15T09:30:00Z",
      "id": 1,
      "name": "My Workflow",
      "revoked": false,
      "sdk_key": {
        "app_id_postfix": "com.example.app",
        "bundle_id_regex": "com.example.*",
        "key": "example-key"
      }
    }
  ]
}

RevokeKey

Revokes an API key or SDK key by ID.

Request: bitdrift.public.unary.admin.v1.RevokeKeyRequest

Response: bitdrift.public.unary.admin.v1.RevokeKeyResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/RevokeKey \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1
}'

Example Response

JSON
{}

UpsertConnector

Upsert a connector for the calling account.

Request: bitdrift.public.unary.admin.v1.UpsertConnectorRequest

Response: bitdrift.public.unary.admin.v1.UpsertConnectorResponse

Example CURL

Bash
curl -X POST https://api.bitdrift.io/bitdrift.public.unary.admin.v1.AdminService/UpsertConnector \
  -H "x-bitdrift-api-key: <key>" \
  -H "Content-Type: application/json" \
  -d '{
  "connector": {
    "cloudwatch_connector_config": {
      "region": "us-east-1",
      "role_arn": "arn:aws:iam::123456789012:role/CloudWatchConnectorRole"
    },
    "name": "example-connector"
  }
}'

Example Response

JSON
{}