openapi: 3.2.0 info: description: These APIs will help you manage different workflows in Blueshift. Our powerful REST APIs provide an easy way to integrate your data and third party applications with Blueshift. version: 1.0.0 title: Blueshift Promotions API contact: email: support@getblueshift.com servers: - url: https://api.getblueshift.com - url: https://api.eu.getblueshift.com tags: - name: Promotions description: Promotions allows you to manage promo codes that you may wish to send to your customers through Blueshift Campaigns paths: /api/v1/promotions/{promotion_uuid}/add_promocodes: put: summary: Add promo codes to promotion description: Use this endpoint to add promo codes to existing promotion. tags: - Promotions security: - user_api_auth: [] parameters: - in: path name: promotion_uuid required: true description: Specify the UUID of the promotion to which you want to add promo codes. schema: type: string requestBody: content: application/json: schema: type: object properties: promocodes: type: array description: Array of promo codes to overwrite the current list. items: type: string example: - promo_code_1 - promo_code_2 - promo_code_3 required: - promocodes description: Specify the array of the promo codes that you want to add to the promotion. responses: '200': description: OK content: application/json: schema: type: object properties: available_codes: type: integer description: Available codes in promotion for consumption by the campaign. example: 6 total_codes: type: integer description: Total codes present in the promotion including available codes and used codes. example: 10 '400': description: Bad request - The request was invalid or cannot be otherwise served. An accompanying error message will explain further. '401': description: Unauthorized - API authentication failed due to an invalid or missing API key. content: application/json: schema: type: object properties: message: type: string example: Not authorized '403': description: Forbidden - The API key does not have sufficient permissions to perform this action. content: application/json: schema: type: object properties: message: type: string example: Forbidden '404': description: Resource not found - Can happen due to resource conflicts. Re-try with exponential backoff. Contact us on support@blueshift.com if the issue persists. '409': description: Conflict error, please retry - The request could not be completed due to a conflict with the current state of the target resource, re-try with exponential backoff. '422': description: Unprocessable Entity - The request was well-formed but contains semantic errors. content: application/json: schema: type: object properties: success: type: boolean example: false error: type: string example: Validation failed '429': description: Too Many Requests - The request limit has been exceeded. Reduce request frequency. content: application/json: schema: type: object properties: message: type: string example: Too Many Requests '500': description: "Internal Server Error\t- Please contact blueshift for more information." '502': description: Service unavailable, please retry - Bad Gateway, re-try with exponential backoff. '503': description: Service unavailable, please retry - Service Unavailable, re-try with exponential backoff. '504': description: Service unavailable, please retry - Gateway Timeout, please re-try with exponential backoff. /api/v1/promotions/{promotion_uuid}/overwrite: put: summary: Overwrite promo codes in promotion description: Use this endpoint to replace all existing promo codes in a promotion with a new set of codes. tags: - Promotions security: - user_api_auth: [] parameters: - in: path name: promotion_uuid required: true description: Specify the UUID of the promotion to which you want to add promo codes. schema: type: string requestBody: content: application/json: schema: type: object properties: promocodes: type: array description: List of promo codes to replace the current set. For testing, enter each promo code individually as a string below. For bulk updates, use the Postman collection to submit multiple promo codes as an array, e.g., `["SUMMER2023", "FALL2023", "WINTER2023"]`. items: type: string example: - SUMMER2023 - FALL2023 - WINTER2023 required: - promocodes description: Specify the array of promo codes that will replace the existing codes in the promotion. responses: '200': description: OK content: application/json: schema: type: object properties: available_codes: type: integer description: Available codes in promotion for consumption by the campaign. example: 6 total_codes: type: integer description: Total codes present in the promotion including available codes and used codes. example: 10 '400': description: Bad request - The request was invalid or cannot be otherwise served. An accompanying error message will explain further. '401': description: Unauthorized - Invalid or missing API key. '403': description: Forbidden - The API key does not have sufficient permissions to perform this action. content: application/json: schema: type: object properties: message: type: string example: Forbidden '404': description: Resource not found - The specified promotion ID was not found. '409': description: Conflict error, please retry - The request could not be completed due to a conflict with the current state of the target resource, re-try with exponential backoff. '422': description: Unprocessable Entity - The request was well-formed but contains semantic errors. content: application/json: schema: type: object properties: success: type: boolean example: false error: type: string example: Validation failed '429': description: Too Many Requests - The request limit has been exceeded. Reduce request frequency. content: application/json: schema: type: object properties: message: type: string example: Too Many Requests '500': description: Internal Server Error - Please contact support for more information. '502': description: Bad Gateway - Please retry the request. '503': description: Service Unavailable - The service is temporarily unavailable. Try again later. '504': description: Gateway Timeout - The server took too long to respond. Retry with exponential backoff. components: securitySchemes: user_api_auth: type: http scheme: basic event_api_auth: type: http scheme: basic