--- title: "Getting an OCI access token (REST)" slug: "getting-an-oci-access-token-rest" updated: 2026-06-29T12:45:47Z published: 2026-06-29T12:45:47Z canonical: "docs.britive.com/getting-an-oci-access-token-rest" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.britive.com/llms.txt > Use this file to discover all available pages before exploring further. # Getting an OCI access token (REST) Use the following cURL command to get an OCI admin token: ```shell curl -X POST /oauth2/v1/token \  -H "Authorization: Basic " \  -H "Content-Type: application/x-www-form-urlencoded" \  -d "grant_type=client_credentials&scope=urn:opc:idm:myscopes" ``` Replace the following fields in the above cURL: | Parameter | Value | | --- | --- | | **** | The domain URL of your Oracle Cloud. | | **** | Encode base 64 the ClientId:ClientSecret. For example: if *client id* “**6cb0d3eda18dfd949es15af9264d6g77**“ and client secret is “**idcscs-6d36a111-71f3-4e66-ase9-8d1eesdee745g**” then we need to encode the base 64 of the string “**6cb0d3eda18dfd949es15af9264d6g77**:**idcscs-6d36a111-71f3-4e66-ase9-8d1eesdee745g**“ | Copy *access_token* from the response for the REST in the following steps. This token is valid for ~1 hour; you need to regenerate it if the token expires.