---
updatedAt: 2026-06-08T03:35:06.000Z
agentTools:
  projectIndex: https://developer.moloco.cloud/llms.txt
---

# Issue a new token.

Issues a new token that gives you access to Moloco Ads APIs.
Tokens are issued by workplace such that you need a unique token for each workplace you would like access to.
Each token is valid for 16 hours, and you will need a new token after the token has expired.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Moloco Ads Campaign Management API",
    "description": "Moloco Ads Campaign Management API provides functionalities for Moloco Ads Campaigns.",
    "version": "1.10",
    "contact": {
      "name": "Moloco Inc.",
      "url": "https://www.moloco.com"
    }
  },
  "paths": {
    "/cm/v1/auth/tokens": {
      "post": {
        "summary": "Issue a new token.",
        "description": "Issues a new token that gives you access to Moloco Ads APIs.\nTokens are issued by workplace such that you need a unique token for each workplace you would like access to.\nEach token is valid for 16 hours, and you will need a new token after the token has expired.",
        "operationId": "DspApi_CreateToken",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagesCreateTokenResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error. Detailed cause can be found in the `details` field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagesCreateTokenError"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/messagesCreateTokenRequest"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Token"
        ],
        "security": []
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://api.moloco.cloud"
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "dspmessagesTokenType": {
        "type": "string",
        "enum": [
          "UNKNOWN_TYPE",
          "AUTH_TOKEN",
          "UPDATE_PASSWORD_TOKEN"
        ],
        "default": "UNKNOWN_TYPE",
        "description": "TokenType enumerates the type of token.\n\n - AUTH_TOKEN: Token returned on the authentication success.\n - UPDATE_PASSWORD_TOKEN: If user didn't update password for over 12 months, it will return `UPDATE_PASSWORD_TOKEN`.\nThis token can be only used for [UpdatePassword API](https://developer.moloco.cloud/reference/dspapi_updatepassword-1).\nhttps://developer.moloco.cloud/reference/dspapi_updatepassword-1"
      },
      "messagesCreateTokenError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "object",
              "$ref": "#/components/schemas/messagesCreateTokenErrorAPIErrorInfo"
            }
          }
        }
      },
      "messagesCreateTokenErrorAPIErrorInfo": {
        "type": "object",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/messagesCreateTokenErrorAPIErrorInfoErrorReason"
          },
          "error_log_id": {
            "type": "string"
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "messagesCreateTokenErrorAPIErrorInfoErrorReason": {
        "type": "string",
        "enum": [
          "ERROR_REASON_UNKNOWN",
          "USER_INVALID_CREDENTIAL_INFORMATION",
          "USER_ACCOUNT_BLOCKED"
        ],
        "default": "ERROR_REASON_UNKNOWN",
        "description": " - USER_INVALID_CREDENTIAL_INFORMATION: The given credential information is invalid.\n - USER_ACCOUNT_BLOCKED: The user account is blocked.\nLogin attempt is not allowed when there are 5 failed login attempts."
      },
      "messagesCreateTokenRequest": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Enter the API key generated from Moloco Cloud DSP."
          }
        }
      },
      "messagesCreateTokenResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Created token."
          },
          "token_type": {
            "$ref": "#/components/schemas/dspmessagesTokenType",
            "description": "Token type."
          }
        }
      }
    }
  }
}
```