Skip to content

Create Scoped Api Key

POST /v1/api-keys/scoped

Create a bank-scoped API key.

Requires a Bearer token with the create_scoped_keys capability. The created key is restricted to the specified banks and has no capabilities.

Authentication required — include an Authorization: Bearer hsk_... header. See Authentication for details.

Request Body

Content-Type: application/json

json
{
  "name": "Name",
  "allowed_bank_ids": [
    "string"
  ],
  "expires_in_days": 0,
  "metadata": {}
}

Example Request

bash
curl -X POST 'https://api.hindsight.vectorize.io/v1/api-keys/scoped' \
  -H 'Authorization: Bearer hsk_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Name",
    "allowed_bank_ids": [
      "string"
    ],
    "expires_in_days": 0,
    "metadata": {}
  }'

Responses

200 — Successful Response

json
{
  "id": "Id",
  "key": "Key",
  "key_prefix": "Key Prefix",
  "tenant_id": "Tenant Id",
  "name": "Name",
  "created_at": "Created At",
  "expires_at": "string",
  "allowed_bank_ids": [
    "string"
  ],
  "message": "Message"
}

422 — Validation Error

json
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "Message",
      "type": "Error Type",
      "input": null,
      "ctx": {},
      "url": "URL"
    }
  ]
}

Source: /v1/api-keys/scoped