Kard Organizations > Placements API

The Organizations > Placements API from Kard — 2 operation(s) for organizations > placements.

OpenAPI Specification

kard-organizations-placements-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference attributions Organizations > Placements API
  version: 1.0.0
servers:
- url: https://rewards-api.getkard.com
  description: Production
- url: https://test-rewards-api.getkard.com
  description: Sandbox
tags:
- name: Organizations > Placements
paths:
  /v2/issuers/{organizationId}/placements:
    post:
      operationId: create
      summary: Create
      description: Create a placement for the organization. Use type "placement" for standard placements (requires name and availableSlots), "placementPushNotification" for push-notification placements (requires name and cadence; availableSlots is automatically set to 1), "placementEmail" for email placements (requires name, cadence, and availableSlots), "placementBatchActivation" for batch-activation placements (requires name, refreshInterval, and slots), or "placementGroup" for group placements (requires name and slots).
      tags:
      - Organizations > Placements
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Created placement resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/placements:PlacementFormatUnion'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '401':
          description: Error response with status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '500':
          description: Error response with status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
      requestBody:
        description: Placement data for creation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_organizations/placements:CreatePlacementRequestBody'
    get:
      operationId: list
      summary: List
      description: List placements belonging to the authenticated organization
      tags:
      - Organizations > Placements
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          type: string
      - name: filter[type]
        in: query
        description: Filter by placement type (placement, placementPushNotification, placementEmail, placementBatchActivation, or placementGroup)
        required: false
        schema:
          $ref: '#/components/schemas/type_organizations/placements:PlacementTypeFilter'
      - name: filter[name]
        in: query
        description: Filter by exact placement name (unique within an organization per type)
        required: false
        schema:
          type: string
      - name: filter[contentStrategyId]
        in: query
        description: Filter by the ID of the content strategy linked to the placement
        required: false
        schema:
          type: string
      - name: include
        in: query
        description: 'CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation or group placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources.'
        required: false
        schema:
          type: string
      - name: page[after]
        in: query
        description: Cursor value for the next page of results
        required: false
        schema:
          type: string
      - name: page[size]
        in: query
        description: Maximum number of records to return [1 - 200] (default = 200)
        required: false
        schema:
          type: integer
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Paginated list of placements
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/placements:PlacementListResponse'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '401':
          description: Error response with status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '500':
          description: Error response with status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
  /v2/issuers/{organizationId}/placements/{placementId}:
    get:
      operationId: get
      summary: Get
      description: Retrieve a specific placement
      tags:
      - Organizations > Placements
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          type: string
      - name: placementId
        in: path
        description: Unique identifier of the placement (UUID v7)
        required: true
        schema:
          type: string
      - name: include
        in: query
        description: 'CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation or group placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources.'
        required: false
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Placement resource (optionally with embedded related resources)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/placements:PlacementResource'
        '401':
          description: Error response with status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '500':
          description: Error response with status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
    put:
      operationId: update
      summary: Update
      description: Replace a placement. All fields must be provided. Use type "placement", "placementPushNotification", "placementEmail", "placementBatchActivation", or "placementGroup" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
      tags:
      - Organizations > Placements
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          type: string
      - name: placementId
        in: path
        description: Unique identifier of the placement (UUID v7)
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Updated placement resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/placements:PlacementFormatUnion'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '401':
          description: Error response with status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '500':
          description: Error response with status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
      requestBody:
        description: Placement data for update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_organizations/placements:UpdatePlacementRequestBody'
    delete:
      operationId: delete
      summary: Delete
      description: Delete a placement
      tags:
      - Organizations > Placements
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the organization
        required: true
        schema:
          type: string
      - name: placementId
        in: path
        description: Unique identifier of the placement (UUID v7)
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_internal-organizations:DeleteResourceResponse'
        '401':
          description: Error response with status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
        '500':
          description: Error response with status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_commons:ErrorResponse'
components:
  schemas:
    type_commons:ErrorSource:
      type: object
      properties:
        pointer:
          type: string
          description: A JSON pointer to the value in the request document that caused the error
        parameter:
          type: string
          description: A string indicating which URI query parameter caused the error
        header:
          type: string
          description: A string indicating the name of a single request header which caused the error
      title: ErrorSource
    type_commons:ErrorObject:
      type: object
      properties:
        status:
          type: string
          description: Status code returned from the request
        title:
          type: string
          description: Name of error
        detail:
          type: string
          description: Description of the specific occurance of the error
        source:
          $ref: '#/components/schemas/type_commons:ErrorSource'
          description: An object containing a reference to the primary source of the error
        id:
          type: string
          description: The id of the resource which caused the error. Always returned for multi-status errors.
      required:
      - status
      - title
      - detail
      title: ErrorObject
    type_commons:EmptyObject:
      type: object
      properties: {}
      title: EmptyObject
    type_internal-organizations:DeleteResourceResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/type_internal-organizations:DeleteResourceData'
      required:
      - data
      description: Response returned after deleting a resource
      title: DeleteResourceResponse
    type_internal-organizations:DeleteResourceData:
      type: object
      properties:
        type:
          type: string
          description: Resource type identifier
        id:
          type: string
          description: ID of the deleted resource
        attributes:
          $ref: '#/components/schemas/type_commons:EmptyObject'
      required:
      - type
      - id
      - attributes
      description: Deleted resource stub
      title: DeleteResourceData
    type_commons:ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/type_commons:ErrorObject'
      required:
      - errors
      title: ErrorResponse
  securitySchemes:
    OAuthScheme:
      type: http
      scheme: bearer