---
updatedAt: 2026-08-06T10:19:00.000Z
agentTools:
  projectIndex: https://developers.bazaarvoice.com/v1.0-SocialCommerceAPI/llms.txt
---

# Exchange an Instagram auth code for a long-life token

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Media API",
    "description": "Curalate Media API",
    "version": "V1"
  },
  "servers": [
    {
      "url": "https://edge.curalate.com"
    }
  ],
  "paths": {
    "/v1/instagram/auth/{code}/exchange": {
      "get": {
        "tags": [
          "Instagram"
        ],
        "summary": "Exchange an Instagram auth code for a long-life token",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "x-qualified-classname": "com.curalate.mediaapi.service.upload.model.oauth.OAuthCode"
            },
            "x-qualified-classname": "com.curalate.mediaapi.service.upload.model.oauth.OAuthCode"
          },
          {
            "name": "redirectUri",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The operation completed successfully and yielded results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExchangeCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "The input parameters are not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorPayload"
                }
              }
            }
          },
          "404": {
            "description": "A requested resource was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorPayload"
                }
              }
            }
          },
          "500": {
            "description": "An unhandled exception has occurred.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorPayload"
                }
              }
            }
          },
          "503": {
            "description": "API is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorPayload"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorPayload": {
        "required": [
          "code",
          "errorId"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "Unknown",
              "MediaApiBadRequest",
              "InvalidInput"
            ]
          },
          "errorId": {
            "type": "string",
            "format": "uuid"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {}
          }
        }
      },
      "ExchangeCodeResponse": {
        "required": [
          "accessToken",
          "userId"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        }
      }
    }
  }
}
```