Skip to content

OAuth apps ​

All path parameters are required.

We support OAuth 2.0 with PKCE. Third-party applications register an OAuth app, redirect users through a consent screen, exchange the resulting authorization code for tokens, and call the API on behalf of those users. All token traffic uses bearer tokens in the standard Authorization header.

These endpoints cover three areas: managing OAuth applications (registration, update, deletion), the authorization flow (consent screen, code exchange, token refresh, revocation), and reviewing or revoking grants that users have already approved.


Applications ​

List OAuth applications ​

GET/v1/oauth/applicationsList OAuth applications

Query parameters

NameTypeRequiredDescription
qstringQuick search by name or ID
idstring[]List of application IDs to filter
namestringFilter by application name
descriptionstringFilter by application description
activebooleanFilter by active status
redirect_uristringFilter by redirect URI (contains match)
ownerstringFilter by owner user ID
limitintegerHow many items to return
pageintegerPage number to fetch
sortstringField to order by
dirstringOrder direction (ASC/DESC)
afterstringForward keyset cursor (for keyset pagination)
beforestringBackward keyset cursor (for keyset pagination)

Lists all registered OAuth applications. Supports pagination and quick search by name or ID, plus filtering by owner user ID.

Administrator only.

bash
curl https://api.galaxygate.net/v1/oauth/applications \
  -A 'curl/8.5' \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN"

Returns 200 OK with a paged list of OAuth application objects.


Register an OAuth application ​

POST/v1/oauth/applicationsRegister a new OAuth application

Creates a new OAuth application. The client_secret is returned only in this response. It cannot be retrieved again. Save it securely. Rotate it with POST /v1/oauth/applications/{apid}/secret if it is ever exposed.

Administrator only.

Request body

FieldTypeRequiredDescription
namestringyesApplication name (4-128 characters)
descriptionstring or nullApplication description (up to 1024 characters)
redirect_urisstring[]yesAllowed redirect URIs. At least one URI. HTTPS required. HTTP is permitted for localhost and 127.0.0.1. Fragments are forbidden.
scopesstring[]yesNonempty set of available scopes this application may request

Returns 200 OK with the application creation response, including client_id and the one-time client_secret.


Fetch an OAuth application ​

GET/v1/oauth/applications/{apid}Get an OAuth application

Returns the full detail for a single OAuth application.

Administrator only.

Path parameters

NameTypeDescription
apidstringApplication ID

Returns 200 OK with the application object. The client_secret is never returned on reads.


Update an OAuth application ​

PATCH/v1/oauth/applications/{apid}Update an OAuth application

Updates the application. All fields are optional. Send only what you are changing. Null leaves a field unchanged. Only the application owner may update it.

Administrator only.

Path parameters

NameTypeDescription
apidstringApplication ID

Request body

FieldTypeDescription
namestring or nullApplication name (4-128 characters)
descriptionstring or nullApplication description (up to 1024 characters)
redirect_urisstring[] or nullUpdated list of allowed redirect URIs
scopesstring[] or nullUpdated set of available scopes
activeboolean or nullSet to false to suspend the application without deleting it

Returns 200 OK with the updated application object.


Delete an OAuth application ​

DELETE/v1/oauth/applications/{apid}Delete an OAuth application

Deletes the application and cascades to all authorization records, codes, and tokens issued to it. This cannot be undone. Only the application owner may delete it.

Administrator only.

Path parameters

NameTypeDescription
apidstringApplication ID

Returns 202 Accepted with an empty body.


Regenerate a client secret ​

POST/v1/oauth/applications/{apid}/secretRegenerate the client secret

Requires administrator access and application ownership. Rotates the client secret. The new plaintext secret is returned only in this response. The old secret is invalidated immediately.

Path parameters

NameTypeDescription
apidstringApplication ID

Returns 200 OK

FieldTypeDescription
client_secretstringNew client secret. Only returned once

List your own OAuth applications ​

GET/v1/users/{uid}/oauth-appsList OAuth applications you own

Path parameters

NameTypeRequiredDescription
uidstringyesUser ID, or @me for the current user

Query parameters

NameTypeRequiredDescription
qstringQuick search by name or ID
idstring[]List of application IDs to filter
namestringFilter by application name
descriptionstringFilter by application description
activebooleanFilter by active status
redirect_uristringFilter by redirect URI (contains match)
ownerstringFilter by owner user ID
limitintegerHow many items to return
pageintegerPage number to fetch
sortstringField to order by
dirstringOrder direction (ASC/DESC)
afterstringForward keyset cursor (for keyset pagination)
beforestringBackward keyset cursor (for keyset pagination)

Lists the OAuth applications owned by the given user. Use @me for the authenticated user. Other users require staff access. Supports pagination and quick search by name or ID.

Returns 200 OK with a paged list of application objects.


Authorization flow ​

The standard PKCE flow is:

  1. Your app generates a code_verifier and computes code_challenge = base64url(SHA-256(code_verifier)).
  2. Redirect the user to the panel's /oauth/authorize page with the parameters described below. The panel calls GET /v1/oauth/authorize to populate its consent screen.
  3. The user approves or denies. The panel calls POST /v1/oauth/authorize and then redirects the user back to your redirect_uri with a code query parameter.
  4. Your server exchanges the code for tokens via POST /v1/oauth/token.
  5. Use the access_token as a bearer token. When it expires, use the refresh_token to obtain a new pair.

GET/v1/oauth/authorizeFetch consent screen details

Returns the application details and requested scopes that the panel uses to render the consent screen. The user must be logged in.

Query parameters

NameTypeRequiredDescription
client_idstringyesApplication client identifier
redirect_uristringyesMust match a registered redirect URI
scopestringyesSpace-delimited list of available scopes
response_typestringyesMust be code
code_challengestringyesbase64url(SHA-256(code_verifier))
code_challenge_methodstringyesMust be S256

Returns 200 OK

FieldTypeDescription
applicationobjectApplication summary: id, name, description
requested_scopesstring[]Scopes the application is asking for
previously_approved_scopesstring[]Scopes this user already approved for this app (empty on first authorization)

Approve or deny an authorization request ​

POST/v1/oauth/authorizeSubmit the consent decision

Called after the user makes a consent decision on the panel's consent screen. The user must be logged in.

Request body

FieldTypeRequiredDescription
client_idstringyesApplication client identifier
redirect_uristringyesMust match a registered redirect URI
response_typestringyesMust be code
scopestring[]yesAvailable scopes the user is approving
statestringyesOpaque value from the original authorization request. Echoed back in the redirect
code_challengestringyesbase64url(SHA-256(code_verifier))
code_challenge_methodstringyesMust be S256
approvebooleanyestrue to approve. false to deny

Returns 200 OK

FieldTypeDescription
redirect_uristringThe redirect URI with code and state appended (on approval), or error and error_description (on denial)

Exchange a code or refresh a token ​

POST/v1/oauth/tokenExchange code or refresh token for access tokens

OAuth 2.0 token endpoint. The request body must be application/x-www-form-urlencoded. No bearer token is required. The client authenticates via client_id and client_secret in the form body.

No authentication required.

Form body - authorization_code grant

FieldTypeRequiredDescription
grant_typestringyesauthorization_code
client_idstringyesApplication client identifier
client_secretstringyesApplication client secret
codestringyesAuthorization code from the redirect
redirect_uristringyesMust match the URI used in the authorization request
code_verifierstringyesPKCE verifier that was hashed to produce code_challenge

Form body - refresh_token grant

FieldTypeRequiredDescription
grant_typestringyesrefresh_token
client_idstringyesApplication client identifier
client_secretstringyesApplication client secret
refresh_tokenstringyesRefresh token from a previous grant or refresh
bash
# Exchange authorization_code
curl -X POST https://api.galaxygate.net/v1/oauth/token \
  -A 'curl/8.5' \
  --data-urlencode grant_type=authorization_code \
  --data-urlencode client_id=gg_client_... \
  --data-urlencode client_secret=gg_secret_... \
  --data-urlencode 'code=<code>' \
  --data-urlencode redirect_uri=https://yourapp.example.com/callback \
  --data-urlencode 'code_verifier=<verifier>'

Returns 200 OK

FieldTypeDescription
access_tokenstringBearer token to use in API calls
token_typestringAlways Bearer
expires_inintegerLifetime of the access token in seconds
refresh_tokenstringToken to use when refreshing. Present on both initial grant and refresh
scopestringGranted scopes, space-delimited

Invalid client credentials return 401 Unauthorized. Other token-exchange errors return 400 Bad Request with a JSON body containing error and error_description.


Revoke a token ​

POST/v1/oauth/revokeRevoke an access or refresh token

RFC 7009 token revocation. The request body must be application/x-www-form-urlencoded. Always returns 200 OK regardless of whether the token was found or the client credentials were valid.

No authentication required.

Form body

FieldTypeRequiredDescription
tokenstringyesAccess or refresh token to revoke
client_idstringyesApplication client identifier
client_secretstringyesApplication client secret

Returns 200 OK with an empty body.


Authorizations ​

An authorization record is created the first time a user approves a consent screen for an application. Revoking it invalidates all access and refresh tokens issued to that application for that user.

List your authorized apps ​

GET/v1/oauth/authorizationsList apps you have authorized

Query parameters

NameTypeRequiredDescription
qstringQuick search by application name or ID
idstring[]List of authorization IDs to filter
namestringFilter by application name
applicationstringFilter by application ID
userstringFilter by user ID
scopestringFilter by scope (exact match, e.g. Instance:read). Values: app:read, app:write, audit:read, dedibox:read, dedibox:write, disk:read, disk:write, floating_ip:read, floating_ip:write, image:read, image:write, instance:read, instance:write, net_balancer:read, net_balancer:write, workspace:read, workspace:write.
limitintegerHow many items to return
pageintegerPage number to fetch
sortstringField to order by
dirstringOrder direction (ASC/DESC)
afterstringForward keyset cursor (for keyset pagination)
beforestringBackward keyset cursor (for keyset pagination)

Lists all OAuth applications the authenticated user has approved. Supports pagination and quick search by application name, plus filtering by application ID. Each entry shows the application, the approved scopes, and when the authorization was granted.

Returns 200 OK with a paged list of authorization objects.


Revoke an authorization ​

DELETE/v1/oauth/authorizations/{auid}Revoke an app authorization

Revokes an authorization and deletes all access and refresh tokens the application holds for this user. The application will need to go through the consent screen again to regain access.

Path parameters

NameTypeDescription
auidstringAuthorization ID

Returns 202 Accepted with an empty body.


List all authorizations (admin) ​

GET/v1/oauth/admin/authorizationsList all authorizations across all users

Query parameters

NameTypeRequiredDescription
qstringQuick search by application name or ID
idstring[]List of authorization IDs to filter
namestringFilter by application name
applicationstringFilter by application ID
userstringFilter by user ID
scopestringFilter by scope (exact match, e.g. Instance:read). Values: app:read, app:write, audit:read, dedibox:read, dedibox:write, disk:read, disk:write, floating_ip:read, floating_ip:write, image:read, image:write, instance:read, instance:write, net_balancer:read, net_balancer:write, workspace:read, workspace:write.
limitintegerHow many items to return
pageintegerPage number to fetch
sortstringField to order by
dirstringOrder direction (ASC/DESC)
afterstringForward keyset cursor (for keyset pagination)
beforestringBackward keyset cursor (for keyset pagination)

Lists every OAuth authorization across all users. Supports pagination and filtering by user ID, application ID, application name, and scope.

Administrator only.

Returns 200 OK with a paged list of full authorization objects, each including the owning user.

Response objects ​

Application object ​

FieldTypeDescription
activebooleanWhether this application is active
client_idstringPublic client identifier
createdstring (ISO 8601)When this application was registered
descriptionstring or nullApplication description
idstringApplication ID
namestringApplication name
ownerobjectStaff member who registered this application
redirect_urisstring[]Allowed redirect URIs
scopesstring[]Available scopes allowed for this application

Application creation response ​

FieldTypeDescription
activebooleanWhether the application is active
client_idstringPublic client identifier
client_secretstringClient secret, save it securely. Only returned once.
createdstring (ISO 8601)When the application was registered
descriptionstringApplication description
idstringApplication ID
namestringApplication name
redirect_urisstring[]Allowed redirect URIs
scopesstring[]Available scopes allowed for this application

Authorization object ​

FieldTypeDescription
applicationobjectOAuth application that was authorized
createdstring (ISO 8601)When this authorization was granted
idstringAuthorization ID
last_usedstring (ISO 8601) or nullWhen this authorization was last used
scopesstring[]Approved scopes

The administrator authorization response also includes a user object with the approving user's id and name.