---
title: "API credentials"
date: "2024-02-14T06:18:38+00:00"
summary: "Securely access Campaign Studio's API functionality with our step-by-step guide. Learn to configure credentials, obtain access tokens, and leverage API features for enhanced marketing automation."
image:
type: "page"
url: "/campaign-studio/api-credentials"
id: "852c0347-84fd-4cb4-a55e-7cbd61c437d1"
---

To use the API functionality in Campaign Studio, do the following:

1.  In **Settings** > **Configuration** >  [**API Settings**](/campaign-studio/configuration "Configuration"), verify the API settings.
2.  In **Settings** > **API Credentials**, configure the API credentials.

Configuring the API credentials[¶](#enabling-api-credentials "Permalink to this heading")
-----------------------------------------------------------------------------------------

To configure the API credentials:

1.  Log in to Campaign Studio.
2.  Click the **Settings** icon.
3.  Click **API Credentials**.
4.  Click **New**.
5.  On the Credentials - New Credential page, in the drop-down list, select _OAuth 2_.
6.  In **Name**, enter a name for the API credential.
7.  In **Redirect URI**, enter one or more URIs that have API access.
8.  Click **Save & Close**.

Obtaining a new access token
----------------------------

1.  Make a POST to the access token’s endpoint oauth/v2/token using the client\_credentials grant type:
    
        POST /oauth/v2/token
        
        client_id=CLIENT_ID
        
            &client_secret=CLIENT_SECRET
        
            &grant_type=client_credentials
    
    The response returned should be a JSON encoded string:
    
        {
        
             access_token: "NEW_ACCESS_TOKEN",
        
             expires_in: 3600,
        
             token_type: "bearer",
        
             scope: ""
        
         }
    

Note

Campaign Studio uses PHP native local codes. If you make changes to the preferred\_locale field for contacts through the API, see the [PHP: Local Manual](https://www.php.net/manual/en/class.locale.php). For a list of countries codes, see this [Letter codes of cultures (languages, countries/regions) list](https://www.venea.net/web/culture_code) and replace the hyphen with an underscore in Campaign Studio.

For more Campaign Studio API documentation, see:

*   [Campaign Studio API quick start guide](/campaign-studio/settings/api-credentials/quick-start)
*   [Campaign Studio API for contact bulk edit](/campaign-studio/settings/api-credentials/contact-bulk-edit)