AperioFlow Start free

Docs API reference

API: organisation, members and billing

34 endpoints. Send your API key as Authorization: Bearer <key> on each request; see The API and AI assistants for keys, errors, idempotency and the conventions every endpoint shares.

POST /api/organisation/export

Download the organisation's data as a JSON file (owners and admins)

Settings, members, invitations, API key labels, secret names, projects, phases, tasks, subtasks, issues with their events, and activity. Secret values, keys and ingest keys are never included. The current password is required again; the ten attempts per hour are shared with the personal export.

Request body (application/json, required).

FieldTypeRequiredDescription
current_passwordstringYes

Responses:

StatusMeaning
200The file
400Current password wrong
403Only owners and admins
429Too many attempts

POST /api/organisation/delete-request

Start deleting the organisation (owners only); a one-hour link goes to your address

Needs the current password, the authenticator or recovery code when two-factor is on, and the organisation's name typed exactly. Refused for organisation 1 and while a Stripe subscription is active, trialing or past due (cancel it in Billing first; the app never changes Stripe). Ten attempts an hour, shared with exports and account deletion. The organisation is deleted only when the emailed link's button is used, at once and for good.

Request body (application/json, required).

FieldTypeRequiredDescription
current_passwordstringYes
codestringNo
confirm_namestringYes

Responses:

StatusMeaning
202The link is on its way
400Password
403Only an owner signed in as themselves can do this
409Organisation 1
429Too many attempts

POST /api/projects/{id}/enable

Switch a project on (admins); needs room under the plan

Projects switched off because the organisation is over its plan are read-only. Switching one on needs fewer active projects than the plan allows; switch another off first, or upgrade.

Parameters:

NameInTypeRequiredDescription
idpathintegerYes

Responses:

StatusMeaning
200The project
404Not found
409The plan has no room for another active project

POST /api/projects/{id}/disable

Switch a project off (admins); it becomes read-only

Parameters:

NameInTypeRequiredDescription
idpathintegerYes

Responses:

StatusMeaning
200The project
404Not found

POST /api/members/{userId}/enable

Switch a member on (owners); needs room under the plan

Parameters:

NameInTypeRequiredDescription
userIdpathintegerYes

Responses:

StatusMeaning
200The member
404Not found
409The plan has no room for another active member

POST /api/members/{userId}/disable

Switch a member off (owners); they cannot use the organisation until switched on

Owners and viewers cannot be switched off. The member's sessions end; their account and work stay.

Parameters:

NameInTypeRequiredDescription
userIdpathintegerYes

Responses:

StatusMeaning
200The member
404Not found
409An owner or a viewer

GET /api/members

People in this organisation, with their roles

Responses:

StatusMeaning
200Members (user_id

PATCH /api/members/{userId}

Change a member's role (admin or owner; only owners touch ownership; the last owner stays)

Parameters:

NameInTypeRequiredDescription
userIdpathintegerYesFrom 1 to ....

Request body (application/json, required).

FieldTypeRequiredDescription
rolestringYesOne of: owner, admin, member, viewer.

Responses:

StatusMeaning
200Changed
403Not allowed for your role
404Not a member of this organisation
409Would leave the organisation without an owner

DELETE /api/members/{userId}

Remove a member (admins), or leave (your own id); their sessions here end

Parameters:

NameInTypeRequiredDescription
userIdpathintegerYesFrom 1 to ....

Responses:

StatusMeaning
204Removed
409Would leave the organisation without an owner

GET /api/invitations

Open invitations (admins)

Responses:

StatusMeaning
200Invitations

POST /api/invitations

Email an invitation (admins; only owners invite owners). Works once, for 7 days.

Request body (application/json, required).

FieldTypeRequiredDescription
emailstring (email)Yes
rolestringYesOne of: owner, admin, member, viewer.

Responses:

StatusMeaning
201Sent
400Invalid

DELETE /api/invitations/{id}

Cancel an open invitation (admins)

Parameters:

NameInTypeRequiredDescription
idpathintegerYesFrom 1 to 2147483647.

Responses:

StatusMeaning
204Cancelled

POST /auth/invitation

What an invitation token is for (organisation, email, role, inviter, whether the address has an account)

Request body (application/json, required).

FieldTypeRequiredDescription
tokenstringYes

Responses:

StatusMeaning
200Invitation details
400Invalid or expired

POST /auth/invitation/accept

Accept an invitation and sign in to the organisation

A new address sends name, password and over_18 true (the time of that confirmation is stored on the account; no date of birth is asked for). An existing account must be signed in as that address (401 with sign_in_required otherwise).

Request body (application/json, required).

FieldTypeRequiredDescription
tokenstringYes
namestringNo
passwordstringNoAt least 10 characters.
over_18booleanNoMust be true for a new account: the person confirms they are 18 or over.

Responses:

StatusMeaning
200Joined and signed in
400Invalid or expired
401Sign in as the invited address first

GET /api/api-keys

Your keys in this organisation (admins see everyone's). Never the key itself.

Responses:

StatusMeaning
200Keys with label

POST /api/api-keys

Make a key (signed-in members; role at most yours). The key is in the response once.

Request body (application/json, required).

FieldTypeRequiredDescription
labelstringYesUp to 100 characters.
rolestringNoOne of: admin, member, viewer. Default "member".

Responses:

StatusMeaning
201The key, in key
403Not signed in as a person

DELETE /api/api-keys/{id}

Revoke a key (yours, or any for an admin)

Parameters:

NameInTypeRequiredDescription
idpathintegerYesFrom 1 to 2147483647.

Responses:

StatusMeaning
204Revoked
404Not found

GET /api/organisation

This organisation's name, plan and settings; admins also see which secrets are set and the GitGuardian webhook address

Responses:

StatusMeaning
200The organisation

PATCH /api/organisation

Change settings (admins) or the name (owners). Settings merge section by section.

Request body (application/json, required).

FieldTypeRequiredDescription
namestringNoUp to 200 characters.
settingsobjectNo

Responses:

StatusMeaning
200Updated
400Unknown or invalid settings
403Not an admin

PUT /api/organisation/secrets/{name}

Store a secret, encrypted (admins). It is never returned.

Parameters:

NameInTypeRequiredDescription
namepathstringYesOne of: gitguardian_webhook_secret.

Request body (application/json, required).

FieldTypeRequiredDescription
valuestringYesUp to 4000 characters.

Responses:

StatusMeaning
200Stored; the organisation with which secrets are set
503The server has no SECRETS_KEY

DELETE /api/organisation/secrets/{name}

Remove a secret (admins)

Parameters:

NameInTypeRequiredDescription
namepathstringYesOne of: gitguardian_webhook_secret.

Responses:

StatusMeaning
200Removed

GET /api/billing

The plan, its limits, usage this month, the subscription, and every plan

Responses:

StatusMeaning
200Billing summary

POST /api/billing/checkout

A Stripe Checkout address to subscribe to Solo or Team (owners)

Request body (application/json, required).

FieldTypeRequiredDescription
planstringYesOne of: solo, team.

Responses:

StatusMeaning
200url to send the owner to
409Already subscribed; use the portal
503Payments are not set up

POST /api/billing/portal

A Stripe customer portal address: change plan, card, invoices, cancel (owners)

Responses:

StatusMeaning
200url

GET /api/github

Connected GitHub installations (owner, own account only; present only when the server has GITHUB_APP=on)

Responses:

StatusMeaning
200The installations (installation_id
403Not an owner signed in with their own account
404GitHub connection is off

POST /api/github/connect

Start connecting GitHub; returns the GitHub address to install the App from (owner only)

Responses:

StatusMeaning
200The install address
403Not an owner signed in with their own account

POST /api/github/link

Link an installation to the organisation (owner only; single-use state from the redirect)

Request body (application/json, required).

FieldTypeRequiredDescription
installation_idintegerYes
statestringYes

Responses:

StatusMeaning
200Linked
400The state or installation was refused
403Not an owner signed in with their own account

PATCH /api/github/installations/{id}

Set whether a merged pull request marks its tasks done (owner only)

Parameters:

NameInTypeRequiredDescription
idpathintegerYes

Request body (application/json, required).

FieldTypeRequiredDescription
merge_sets_donebooleanNo

Responses:

StatusMeaning
200Updated
404Not found

DELETE /api/github/installations/{id}

Disconnect and delete the installation and every link made through it (owner only)

Parameters:

NameInTypeRequiredDescription
idpathintegerYes

Responses:

StatusMeaning
200Deleted
404Not found

POST /webhooks/github

GitHub's own delivery address (signature on the raw body checked first; 404 when off)

Responses:

StatusMeaning
200Handled or ignored
401Bad or missing signature
429Rate limited

GET /api/actions-minutes

The month's Actions minutes, for the account and each project

A repository counts towards the first project (by id) whose repo_url links it; the rest are listed in unmatched. Projects with a repository link, an allowance or usage are listed, those with an allowance or usage first.

Parameters:

NameInTypeRequiredDescription
monthquerystringNoYYYY-MM (default this month, UTC)

Responses:

StatusMeaning
200The month's figures (ActionsMinutes)
400The request body is invalid or is not valid JSON (Error)
401Missing or invalid API key (Error)
503Actions minutes are not configured on the server

POST /api/actions-minutes/refresh

Read GitHub's usage report now

At most once a minute. A failed read keeps the last figures and sets error (the HTTP status only).

Parameters:

NameInTypeRequiredDescription
monthquerystringNoYYYY-MM (default this month, UTC)

Responses:

StatusMeaning
200The month's figures after the read (ActionsMinutes)
401Missing or invalid API key (Error)
429Refreshed less than a minute ago
503GitHub is not set up for Actions usage on this server

GET /api/projects/{id}/actions-minutes

One project's minutes, and whether a planned build fits

fits is true only when live figures have been read this month, the project has an allowance, its used + planned is within it, and the account's used + planned + reserve is within the plan. reasons says why not. Build guards call this before a paid runner starts.

Parameters:

NameInTypeRequiredDescription
idpathintegerYesFrom 1 to 2147483647.
plannedqueryintegerNoMinutes the build about to start is expected to use (runner multiplier applied). From 0 to ....

Responses:

StatusMeaning
200The project's figures (ProjectActionsMinutes)
400The request body is invalid or is not valid JSON (Error)
401Missing or invalid API key (Error)
404Item (or its parent) does not exist (Error)

PUT /api/projects/{id}/actions-allowance

Set or remove a project's monthly allowance

All the allowances together can be at most the plan less the reserve (3,000 less 100 by default); a value that would pass it is refused with how much is left. The change is in the activity log.

Parameters:

NameInTypeRequiredDescription
idpathintegerYesFrom 1 to 2147483647.

Request body (application/json, required).

FieldTypeRequiredDescription
monthly_minutesinteger or nullYesMinutes a month. From 0 to ....

Responses:

StatusMeaning
200The project's figures with the new allowance (ProjectActionsMinutes)
400The request body is invalid or is not valid JSON (Error)
401Missing or invalid API key (Error)
404Item (or its parent) does not exist (Error)

Start free All the docs Video guides

Built for the people who write the code and answer the phone when it breaks.

Run from the UK. Hosted in France.

UK time --:--

Already in?Open the app Start free today
View our policies