Skip to content
Suomi

Register a public key for an integration

POST
/v1/integrations/{clientId}/keys
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "public_jwk": { "additionalProperty": "example" }, "public_key_pem": "example", "alg": "ES256" }'

A JWK or PEM public key; a private key is refused. At most two live keys. Not for the calling integration itself, and only for an integration whose scopes and projects the caller holds and that is on no other organisation’s project, since the key lets its holder act as it.

clientId
required
string format: uuid
Media typeapplication/json

The body of addIntegrationKey: public_jwk or public_key_pem.

object
public_jwk
object
key
additional properties
public_key_pem

A PEM SubjectPublicKeyInfo.

string
<= 8192 characters
alg

ES256 or RS256.

string
Allowed values: ES256 RS256

The key

Media typeapplication/json

An integration’s public key.

object
kid
required

The key’s id: its RFC 7638 thumbprint.

string
alg
required

ES256 or RS256.

string
Allowed values: ES256 RS256
thumbprint
required

The RFC 7638 thumbprint.

string
public_jwk
required
object
key
additional properties
created_at
required

When it was registered.

string
expires_at
required

When it expires: a year after it was registered.

string
revoked_at
required

When it was revoked.

string | null

Example

{
"alg": "ES256"
}

PRIVATE_KEY_REFUSED; INTEGRATION_KEY_INVALID

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation’s project admitted; PUBLIC_API_DISABLED

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

No such integration in the organisation

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}