Docs
API keys
POST
/api-keys

The full key is in the key field of this response and is never shown again. Grant rights with scopes (an allow list), or with the permission shorthand: readwrite = every current scope, readonly = every read scope. A write scope includes reading the same resource.

Requires api_keys:write and a key with access to all profiles.

Authorization

bearerAuth
AuthorizationBearer <token>

API key starting with fh_

In: header

Header Parameters

Idempotency-Key?string

Any unique string up to 255 characters. A retry with the same key within 24 hours returns the first response instead of running again.

Lengthlength <= 255

Request Body

application/json

name*string
Length1 <= length <= 100
scopes?array<>

Rights of the key. Wins over permission

Items1 <= items
permission?string

Shorthand used when scopes is left out

Default"readwrite"
Value in"readwrite" | "readonly"
fullAccess?boolean

true = all profiles, including future ones

Defaulttrue
profileIds?array<>

Profiles the key may use when fullAccess is false

expiresAt?string

ISO 8601 timestamp

Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://feedhorizon.com/api/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "data": {
    "id": "key_0195f0a27b3c7d4e8f5a1b2c3d4e5f60",
    "keyPrefix": "string",
    "name": "string",
    "permission": "readwrite",
    "scopes": [
      "profiles:read"
    ],
    "fullAccess": true,
    "profileIds": [
      "prof_0195f0a27b3c7d4e8f5a1b2c3d4e5f60"
    ],
    "lastUsedAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "key": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "string",
    "message": "string",
    "param": "string",
    "details": [
      {
        "param": "string",
        "code": "string",
        "message": "string"
      }
    ],
    "docUrl": "http://example.com",
    "requestId": "string"
  }
}