Skip to content
Suomi

Change an integration's name, scopes or projects

PATCH
/v1/integrations/{clientId}
Code sample: Shell / cURL
curl --request PATCH \
--url https://api.whatsbuilt.fi/v1/integrations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "scopes": [ "read" ], "project_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "all_projects": true }'

Not the calling integration itself or one up its creator chain (INTEGRATION_SELF). Every scope and project the integration has after the change must be the caller’s own, so a weaker caller changes a stronger integration only by also taking away the scopes it lacks; it can disable or revoke it.

clientId
required
string format: uuid
Media typeapplication/json

The body of updateIntegration.

object
name

1 to 100 characters after the trim.

string
>= 1 characters <= 100 characters
description

At most 500 characters after the trim; null clears it.

string | null
<= 500 characters
scopes

The whole list

Array<string>
<= 25 items
Allowed values: read projects:read projects:write members:write organisation:admin models:read models:write models:delete elements:read elements:write elements:delete element-events:write schedule:read schedule:write inspections:read inspections:write inspections:delete inspections:attest findings:read findings:write findings:delete finding-drafts:write maintenance:read maintenance:write exports:read
project_ids

The organisation’s projects it is on afterwards.

Array<string>
<= 1000 items
all_projects

Every project of the organisation, new ones included.

boolean

The integration

Media typeapplication/json

An integration as the admin pages and /v1 show it.

object
client_id
required

The integration’s id, its OAuth client_id.

string format: uuid
name
required

Its name.

string
description
required

What it is for.

string | null
scopes
required

Its scopes.

Array<string>
all_projects
required

Whether it is on every project of the organisation, new ones included.

boolean
project_role
required

The project role its scopes give it.

string
Allowed values: viewer inspector admin
status
required

active, disabled or revoked.

string
Allowed values: active disabled revoked
created_by
required

Who created it.

string | null
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
created_at
required

When it was created.

string
last_used_at
required

When its token was last used.

string | null
disabled_at
required

When it was disabled.

string | null
revoked_at
required

When it was revoked.

string | null
calls_24h
required

Its calls in the last 24 hours.

integer format: int32
project_ids
required

The organisation’s own projects it is on.

Array<string>
other_projects
required

Projects of other organisations whose project admins added it.

Array<object>

A project of another organisation whose project admin added the integration (spec 056 §16, 5b).

object
project_id
required

The project.

string format: uuid
name
required

The project’s name.

string
owner_account_name
required

The organisation that owns the project.

string
project_role
required

The role its project admin gave.

string
Allowed values: viewer inspector
added_at
required

When the integration joined it.

string
keys
required

Its keys, oldest first.

Array<object>

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

{
"project_role": "viewer",
"status": "active",
"other_projects": [
{
"project_role": "viewer"
}
],
"keys": [
{
"alg": "ES256"
}
]
}

Invalid body or parameters

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"
}