openapi: 3.2.0 info: title: Campaign Build Audiences API version: latest servers: - url: https://api.cardlytics.com description: Base URL declared by the provider in apis.yml (roadmap#122). security: - oauth2-cognito: - read tags: - name: Audiences paths: /v8/accounts/{accountId}/Audiences: get: tags: - Audiences summary: Returns all Audiences from the repository for a given account. parameters: - name: accountId in: path description: The accountId for which to retrieve Audiences. required: true schema: type: string - name: PerPage in: query schema: minimum: 1 type: integer format: int32 - name: Page in: query schema: minimum: 1 type: integer format: int32 - name: isUserSavedAudience in: query description: 'Parameters to filter only user saved or all audiences(Default: false).' schema: default: false - name: includeGeo in: query description: 'Parameters to include and exclude Geo info in the audiences(Default: false).' schema: default: false responses: '200': description: The list of audiences was found and returned in the response body. content: text/plain: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' post: tags: - Audiences summary: Adds an audience to the repository. parameters: - name: accountId in: path description: The accountId associated with the audience. required: true schema: type: string requestBody: description: The audience to add to the repository. content: application/json-patch+json: schema: $ref: '#/components/schemas/PostAudienceResourceModel' application/json: schema: $ref: '#/components/schemas/PostAudienceResourceModel' text/json: schema: $ref: '#/components/schemas/PostAudienceResourceModel' application/*+json: schema: $ref: '#/components/schemas/PostAudienceResourceModel' responses: '201': description: The audience was created; the response contains the new entity and the route to retrieve it from this controller. content: text/plain: schema: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' /v8/Audiences: get: tags: - Audiences summary: Returns all Audiences from the repository. parameters: - name: PerPage in: query schema: minimum: 1 type: integer format: int32 - name: Page in: query schema: minimum: 1 type: integer format: int32 - name: isUserSavedAudience in: query description: 'Parameters to filter only user saved or all audiences(Default: false).' schema: default: false - name: includeGeo in: query description: 'Parameters to include and exclude Geo info in the audiences(Default: false).' schema: default: false responses: '200': description: The list of audiences was found and returned in the response body. content: text/plain: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: type: array items: $ref: '#/components/schemas/GetAudienceResourceModel' /v8/accounts/{accountId}/Audiences/{audienceId}: get: tags: - Audiences summary: Returns an audience from the repository for a given account by its AudienceId. parameters: - name: accountId in: path description: The accountId associated with the audience. required: true schema: type: string - name: audienceId in: path description: The audienceId to find. required: true schema: type: integer format: int32 responses: '200': description: The audience was found and returned in the response body. content: text/plain: schema: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' '404': description: The audience was not found. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' patch: tags: - Audiences summary: Partial modifications to an Audience. parameters: - name: accountId in: path description: The accountId of the user to filter the request. required: true schema: type: string - name: audienceId in: path description: The Id of the Audience to be modified. required: true schema: type: integer format: int32 requestBody: description: The Audience with its updates in Json Patch document format. content: application/json-patch+json: schema: type: array items: $ref: '#/components/schemas/Operation' application/json: schema: type: array items: $ref: '#/components/schemas/Operation' text/json: schema: type: array items: $ref: '#/components/schemas/Operation' application/*+json: schema: type: array items: $ref: '#/components/schemas/Operation' responses: '200': description: The Audience was found and updated; the updated entity is returned in the response body. content: text/plain: schema: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' '400': description: The Audience specified in the route does not match the value specified in the request body. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: The Audience was not found. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' /v8/Audiences/{audienceId}: get: tags: - Audiences summary: Returns an audience from the repository by its AudienceId. parameters: - name: audienceId in: path description: The audienceId to find. required: true schema: type: integer format: int32 responses: '200': description: The audience was found and returned in the response body. content: text/plain: schema: $ref: '#/components/schemas/GetAudienceResourceModel' application/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' text/json: schema: $ref: '#/components/schemas/GetAudienceResourceModel' '404': description: The audience was not found. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' /v8/accounts/{accountId}/Audiences/{audienceId}/validation: get: tags: - Audiences summary: Validates an Audience with all business rules. parameters: - name: accountId in: path description: The accountId of the user to filter the request. required: true schema: type: string - name: audienceId in: path description: The audienceId to find. required: true schema: type: integer format: int32 responses: '200': description: The Audience was found and the validation result is returned in the response body. content: text/plain: schema: $ref: '#/components/schemas/GetValidationResourceModel' application/json: schema: $ref: '#/components/schemas/GetValidationResourceModel' text/json: schema: $ref: '#/components/schemas/GetValidationResourceModel' '404': description: The Audience was not found. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' /v8/Audiences/validation/rule-set: get: tags: - Audiences summary: Returns validation rules for a Audience object. responses: '200': description: The Audience validation rules are returned in the response body. content: text/plain: schema: $ref: '#/components/schemas/GetValidationDefinitionResourceModel' application/json: schema: $ref: '#/components/schemas/GetValidationDefinitionResourceModel' text/json: schema: $ref: '#/components/schemas/GetValidationDefinitionResourceModel' components: schemas: GetAudienceResourceModel: type: object properties: customAudiences: $ref: '#/components/schemas/GetCustomAudienceResourceModel' createDateTime: type: string format: date-time example: '1987-03-18T00:00:00.0000000-08:00' updateDateTime: type: string format: date-time example: '1987-03-18T00:00:00.0000000-08:00' audienceSegmentationTypeId: type: - integer - 'null' format: int32 selectedSegmentIds: type: - array - 'null' items: type: integer format: int64 audienceId: type: integer format: int32 name: type: - string - 'null' accountId: type: - string - 'null' createUser: type: - string - 'null' updateUser: type: - string - 'null' locations: $ref: '#/components/schemas/GetGeoLocationsResourceModel' purchaseBehavior: $ref: '#/components/schemas/IPurchaseBehaviorResourceModel' additionalProperties: false PostGeoLocationsReferenceResourceModel: type: object properties: include: type: - array - 'null' items: $ref: '#/components/schemas/IPostGeoReferenceResourceModel' exclude: type: - array - 'null' items: $ref: '#/components/schemas/IPostGeoReferenceResourceModel' additionalProperties: false PostAudienceResourceModel: required: - purchaseBehavior type: object properties: customAudiences: $ref: '#/components/schemas/PostCustomAudienceResourceModel' audienceSegmentationTypeId: type: - integer - 'null' format: int32 selectedSegmentIds: type: - array - 'null' items: type: integer format: int64 name: type: - string - 'null' isUserSavedAudience: default: false locations: $ref: '#/components/schemas/PostGeoLocationsReferenceResourceModel' purchaseBehavior: $ref: '#/components/schemas/IPostPurchaseBehaviorResourceModel' additionalProperties: false GeoType: enum: - COUNTRY - REGION - LOCALITY - DMA - POSTAL_CODE type: string IPostGeoReferenceResourceModel: type: object properties: id: type: integer format: int32 geoType: $ref: '#/components/schemas/GeoType' additionalProperties: false GetValidationResourceModel: type: object properties: isValid: default: false errors: type: - object - 'null' additionalProperties: type: array items: type: string type: type: - string - 'null' title: type: - string - 'null' status: type: - integer - 'null' format: int32 detail: type: - string - 'null' instance: type: - string - 'null' additionalProperties: {} description: Get Validation endpoint resource model. GetValidationDefinitionResourceModel: type: object properties: typeName: type: - string - 'null' ruleSet: type: - array - 'null' items: $ref: '#/components/schemas/RuleDefinition' additionalProperties: false description: Get Validation Definition resource model. GetGeoLocationsResourceModel: type: object properties: include: type: - array - 'null' items: $ref: '#/components/schemas/IGetGeoResourceModel' exclude: type: - array - 'null' items: $ref: '#/components/schemas/IGetGeoResourceModel' count: $ref: '#/components/schemas/GetGeoLocationCountResourceModel' additionalProperties: false Operation: type: object properties: value: {} path: type: - string - 'null' op: type: - string - 'null' from: type: - string - 'null' additionalProperties: false IPurchaseBehaviorResourceModel: type: object properties: type: $ref: '#/components/schemas/PurchaseBehaviorType' additionalProperties: false IGetGeoResourceModel: type: object properties: id: type: integer format: int32 readOnly: true geoType: $ref: '#/components/schemas/GeoType' additionalProperties: false IPostPurchaseBehaviorResourceModel: type: object properties: type: $ref: '#/components/schemas/PurchaseBehaviorType' additionalProperties: false GetCustomAudienceResourceModel: type: object properties: include: $ref: '#/components/schemas/CustomAudience' exclude: $ref: '#/components/schemas/CustomAudience' additionalProperties: false PostCustomAudienceResourceModel: type: object properties: include: $ref: '#/components/schemas/CustomAudience' exclude: $ref: '#/components/schemas/CustomAudience' additionalProperties: false GetGeoLocationCountResourceModel: type: object properties: include: type: integer format: int32 exclude: type: integer format: int32 additionalProperties: false RuleDefinition: type: object properties: propertyName: type: - string - 'null' ruleType: $ref: '#/components/schemas/RuleTypes' valueType: type: - string - 'null' errorMessage: type: - string - 'null' additionalProperties: false CustomAudience: type: object properties: customAudienceId: type: integer format: int64 fileName: type: - string - 'null' description: type: - string - 'null' additionalProperties: false ProblemDetails: type: object properties: type: type: - string - 'null' title: type: - string - 'null' status: type: - integer - 'null' format: int32 detail: type: - string - 'null' instance: type: - string - 'null' additionalProperties: {} PurchaseBehaviorType: enum: - CARDLYTICS_DETERMINED - BY_CATEGORY - EXPANDED type: string RuleTypes: enum: - Required - GreaterThan - GreaterThanOrEqualTo - LessThan - Length - Enum - EnumNotDefaulted - InclusiveBetween - ExclusiveBetween - NotEqual - UniqueCollection type: string description: Validation rule definition types. securitySchemes: oauth2-cognito: type: oauth2 flows: authorizationCode: authorizationUrl: https://advertiser-auth-preprod.auth.us-east-1.amazoncognito.com/oauth2/authorize tokenUrl: https://advertiser-auth-preprod.auth.us-east-1.amazoncognito.com/oauth2/token scopes: openid: openid x-tokenName: id_token