Skip to main content

Authorization

Kopo Kopo uses Oauth2 to allow access to the Kopo Kopo API. You can view the API Authorization guide at our developer portal. Access to the API can be granted on behalf of the user or of the application itself.

The client credentials flow is used when an application needs to obtain permission to act on its own behalf. The application will exchange its client_id, client_secret and grant_type=client_credentials for an application's access token.

The Kopo Kopo API then expects the application access token to be used to make calls to the Kopo Kopo API on behalf of the application. The Kopo Kopo API expects the application access token to be included in subsequent API calls via the Authorization HTTP header:

Authorization: Bearer {application_access_token_here}

info

You must replace {application_access_token_here} with your Oauth2 application access token. The access token is only valid for 1 hour after the created_at date.

Request application authorization​

To request application authorization, use this code:

# With json, you can just pass the correct header with each request
curl -d "client_id=CGQXLrlfuOqdUYdTcLz3rBiCZQDRvdWIUPkwasGMuGhkem9Bo&client_secret=g7QLwvO37aN2HoKx1amekWi8a2g7AIuPbD5CcJSLqXIcDOxfTr&grant_type=client_credentials"
-H "Content-Type: application/x-www-form-urlencoded"
-H "User-Agent: <product>/<product-version> <comment>"
"https://sandbox.kopokopo.com/oauth/token"

On success the response has JSON structured like this

{
"access_token": "JCGQXLrlfuOqdUYdTcLz3rBiCZQDRvdWIUPkw++GMuGhkem9Bo",
"token_type": "Bearer",
"expires_in": 3600,
"created_at": "2026-04-27T00:09:15+03:00"
}

The client credentials flow is the simplest OAuth 2 grant, with a server-to-server exchange of your application’s client_id, client_secret for an OAuth application access token. In order to execute this flow, you will need to make an HTTP request from your application server, to the Kopo Kopo authorization server.

HTTP Request​

POST https://sandbox.kopokopo.com/oauth/token
User-Agent: "< product >/< product-version > < comment >"

Request Parameters​

ParameterRequiredTypeDescription
client_idyesstringApplication key. Navigate to https://app.kopokopo.com/applications (production) or https://sandbox.kopokopo.com/applications (Sandbox) for your application key
client_secretyesstringApplication secret. Only revealed to the user when creating an application or during regeneration of client credentials.
grant_typeyesstringThis must be set to client_credentials.
tip

Remember — The access token will be needed for all subsequent calls to the Kopo Kopo API. Only one access token is valid at a time.

Revoke application's access token​

To revoke an application's access token, use this code:

# Pass the correct parameters with each request
curl -H "User-Agent: <product>/<product-version> <comment>"
-F "client_id=9b36d8c0db59eff5038aea7a417d73e69aea75b41aac771816d2ef1b3109cc2f"
-F "client_secret=d6ea27703957b69939b8104ed4524595e210cd2e79af587744a7eb6e58f5b3d2"
-F "token=dbaf9757982a9e738f05d249b7b5b4a266b3a139049317c4909f2f263572c781"
-X POST "https://sandbox.kopokopo.com/oauth/revoke"

On success a 200 response with an empty body is returned

{}

The request is used to revoke a particular token at a time.

HTTP Request​

POST https://sandbox.kopokopo.com/oauth/revoke
User-Agent: "< product >/< product-version > < comment >"

Request Parameters​

ParameterRequiredTypeDescription
client_idyesstringApplication key. Navigate to https://app.kopokopo.com/applications (production) or https://sandbox.kopokopo.com/applications (Sandbox) for your application key
client_secretyesstringApplication secret. Only revealed to the user when creating an application or during regeneration of client credentials.
tokenyesstringThe access token belonging to the application that is to be revoked.
warning

The access token will be unusable for all subsequent calls to the Kopo Kopo API

Request token introspection​

To introspect an application access token, use this code:

# With json, pass the correct parameters with each request
curl -H "User-Agent: <product>/<product-version> <comment>"
-F "client_id=9b36d8c0db59eff5038aea7a417d73e69aea75b41aac771816d2ef1b3109cc2f"
-F "client_secret=d6ea27703957b69939b8104ed4524595e210cd2e79af587744a7eb6e58f5b3d2"
-F "token=dbaf9757982a9e738f05d249b7b5b4a266b3a139049317c4909f2f263572c781"
-X POST "https://sandbox.kopokopo.com/oauth/introspect"

On success the response has JSON structured like this

{
"active": true,
"scope": "",
"client_id": "_9fXMGROLmSegBhofF6z-qDKHH5L6FsbMn2MgG24Xnk",
"token_type": "Bearer",
"exp": 1613384155,
"iat": 1613376955
}

It can be used to check the validity of your access tokens, and find out other information such as which user and which scopes are associated with the token. The client secret will not be displayed as that is to remain confidential with the application owner.

HTTP Request​

POST https://sandbox.kopokopo.com/oauth/introspect
User-Agent: "< product >/< product-version > < comment >"

Request Parameters​

ParameterRequiredTypeDescription
client_idyesstringApplication key. Navigate to https://app.kopokopo.com/applications (production) or https://sandbox.kopokopo.com/applications (Sandbox) for your application key
client_secretyesstringApplication secret. Only revealed to the user when creating an application or during regeneration of client credentials.
tokenyesstringThe access token belonging to the application.

Request token information​

To request information concerning an application's access token, use this code:

# With json, you can just pass the correct header with each request
curl -H "Authorization: Bearer access_token"
-H "User-Agent: <product>/<product-version> <comment>"
"https://sandbox.kopokopo.com/oauth/token/info"

On success the response has JSON structured like this

{
"resource_owner_id": null,
"scope": [],
"expires_in": 4498,
"application": {
"uid": "_9fXMGROLmSegBhofF6z-qDKHH5L6FsbMn2MgG24Xnk"
},
"created_at": 1613376955
}

Shows details about the token used for authentication.

HTTP Request​

GET https://sandbox.kopokopo.com/oauth/token/info
User-Agent: "< product >/< product-version > < comment >"