Kard Organizations > Children API

The Organizations > Children API from Kard — 2 operation(s) for organizations > children.

OpenAPI Specification

kard-organizations-children-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference attributions Organizations > Children 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 > Children
paths:
  /v2/issuers/{organizationId}/children:
    get:
      operationId: list
      summary: List
      description: List child organizations belonging to the authenticated issuer
      tags:
      - Organizations > Children
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the parent organization
        required: true
        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 child organizations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/children:ChildOrganizationListResponse'
        '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'
    post:
      operationId: create
      summary: Create
      description: Create a child organization by cloning the parent and overriding specified fields. An 8-digit numeric ID is generated automatically. The name is required, must contain at least one letter, and may contain only letters and spaces.
      tags:
      - Organizations > Children
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the parent organization
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Created child organization resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/children:ChildOrganizationResponse'
        '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'
        '409':
          description: Error response with status 409
          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: Child organization data for creation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_organizations/children:CreateChildRequestBody'
  /v2/issuers/{organizationId}/children/{childId}:
    get:
      operationId: get
      summary: Get
      description: Retrieve a specific child organization
      tags:
      - Organizations > Children
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the parent organization
        required: true
        schema:
          type: string
      - name: childId
        in: path
        description: Unique identifier of the child organization
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Child organization resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/children:ChildOrganizationResponse'
        '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'
    patch:
      operationId: update
      summary: Update
      description: Update a child organization. Only the name can be changed.
      tags:
      - Organizations > Children
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the parent organization
        required: true
        schema:
          type: string
      - name: childId
        in: path
        description: Unique identifier of the child organization
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Updated child organization resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_organizations/children:ChildOrganizationResponse'
        '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: Child organization data for update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_organizations/children:UpdateChildRequestBody'
    delete:
      operationId: delete
      summary: Delete
      description: Delete a child organization
      tags:
      - Organizations > Children
      parameters:
      - name: organizationId
        in: path
        description: Unique identifier of the parent organization
        required: true
        schema:
          type: string
      - name: childId
        in: path
        description: Unique identifier of the child organization
        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