x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v2
consumes:
  - application/json
produces:
  - application/json
paths:
  /custom-field-definitions:
    get:
      tags:
        - Custom Field Definitions
      summary: List custom fields and their definitions.
      operationId: CustomFieldDefinitions_GetCustomFieldDefinitions
      parameters:
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            type: array
            items:
              $ref: '#/definitions/CustomFieldDefinitionResource'
      security:
        - api_key: []
    post:
      tags:
        - Custom Field Definitions
      summary: Create a custom field definition and its possible values (if any).
      operationId: CustomFieldDefinitions_CreateCustomField
      parameters:
        - name: request
          in: body
          description: >-
            The request to create a custom field definition and its possible
            values (if any).
          schema:
            $ref: '#/definitions/CreateCustomFieldDefinitionRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '201':
          description: ''
        '400':
          x-nullable: false
          description: Custom Field Definition not accepted.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '409':
          x-nullable: false
          description: Custom Field Definition with given Custom Field already exists.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /custom-field-definitions/{customFieldDefinitionId}:
    get:
      tags:
        - Custom Field Definitions
      summary: Get a specific custom field and it's definition.
      operationId: CustomFieldDefinitions_GetCustomFieldDefinition
      parameters:
        - type: string
          name: customFieldDefinitionId
          in: path
          required: true
          description: The custom field definition ID.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/CustomFieldDefinitionResource'
        '404':
          x-nullable: false
          description: Custom Field Definition not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    put:
      tags:
        - Custom Field Definitions
      summary: Update a custom field definition and its possible values (if any).
      operationId: CustomFieldDefinitions_UpdateCustomField
      parameters:
        - type: string
          name: customFieldDefinitionId
          in: path
          required: true
          description: The custom field definition ID.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: >-
            The request body to update a custom field definition and its
            possible values (if any).
          schema:
            $ref: '#/definitions/UpdateCustomFieldDefinitionRequestBody'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '204':
          description: ''
        '400':
          x-nullable: false
          description: Custom Field not accepted.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '404':
          x-nullable: false
          description: Custom Field Definition not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '409':
          x-nullable: false
          description: Custom Field Definition with given ID already exists.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  CustomFieldDefinitionResource:
    type: object
    description: Resource for a custom field definition.
    properties:
      id:
        type: string
        description: The custom field definition ID.
        format: guid
      name:
        type: string
        description: The custom field definition descriptive name.
      customField:
        type: string
        description: The name of the custom field.
      type:
        description: >-
          The field type.


          Possible Enum Values: `0 = Boolean` `1 = Date` `2 = DateTime` `3 =
          Decimal` `4 = Integer` `5 = Text` 
        allOf:
          - $ref: '#/definitions/FieldDefinitionTypes'
      behavior:
        description: >-
          The behaviour of the field.


          Possible Enum Values: `0 = Optional` `1 = Required` `2 = Hidden` `3 =
          Locked` `4 = ReadOnly` 
        allOf:
          - $ref: '#/definitions/CustomFieldBehaviors'
      possibleValues:
        type: array
        description: List of possible values for this field.
        items:
          $ref: '#/definitions/CustomFieldDefinitionPossibleValueResource'
      isPrivate:
        type: boolean
        description: True if this field is private, false otherwise.
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  FieldDefinitionTypes:
    type: integer
    description: Enum specifying the type of custom field.
    x-enumNames:
      - Boolean
      - Date
      - DateTime
      - Decimal
      - Integer
      - Text
    enum:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
  CustomFieldBehaviors:
    type: integer
    description: Enum specifying the type of custom field behavior.
    x-enumNames:
      - Optional
      - Required
      - Hidden
      - Locked
      - ReadOnly
    enum:
      - 0
      - 1
      - 2
      - 3
      - 4
  CustomFieldDefinitionPossibleValueResource:
    type: object
    description: Resource for a custom field definition's possible value.
    properties:
      id:
        type: string
        description: The unique identifier of this possible value.
        format: guid
      customFieldDefinitionId:
        type: string
        description: The custom field definition Id.
        format: guid
      name:
        type: string
        description: The name for this custom field possible value.
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
  CreateCustomFieldDefinitionRequest:
    type: object
    description: >-
      The request to create a custom field definition and its possible values
      (if any).
    required:
      - name
      - customField
      - type
      - behavior
      - isPrivate
    properties:
      name:
        type: string
        description: The name of the custom field definition.
        maxLength: 255
        minLength: 0
      customField:
        type: string
        description: The custom field it is related to (e.g. "String2", "Bool1").
        maxLength: 255
        minLength: 0
      type:
        description: >-
          The field definition type.


          Possible Enum Values: `0 = Boolean` `1 = Date` `2 = DateTime` `3 =
          Decimal` `4 = Integer` `5 = Text` 
        allOf:
          - $ref: '#/definitions/FieldDefinitionTypes'
      behavior:
        description: >-
          The behavior of the custom field definition.


          Possible Enum Values: `0 = Optional` `1 = Required` `2 = Hidden` `3 =
          Locked` `4 = ReadOnly` 
        allOf:
          - $ref: '#/definitions/CustomFieldBehaviors'
      isPrivate:
        type: boolean
        description: True if the field is private, False otherwise.
      regex:
        type: string
        description: The regex for the custom field definition, if any.
        maxLength: 255
        minLength: 0
      order:
        type: integer
        description: The order of the custom field definition.
        format: int32
      possibleValues:
        type: array
        description: A list of possible custom field definition values.
        items:
          type: string
  UpdateCustomFieldDefinitionRequestBody:
    type: object
    description: >-
      The request to update a custom field definition and its possible values
      (if any).
    properties:
      name:
        type: string
        description: The name of the custom field definition.
        maxLength: 255
        minLength: 0
      customField:
        type: string
        description: The custom field it is related to (e.g. "String2", "Bool1").
        maxLength: 255
        minLength: 0
      behavior:
        description: >-
          The behavior of the custom field definition.


          Possible Enum Values: `0 = Optional` `1 = Required` `2 = Hidden` `3 =
          Locked` `4 = ReadOnly` 
        allOf:
          - $ref: '#/definitions/CustomFieldBehaviors'
      isPrivate:
        type: boolean
        description: True if the field is private, False otherwise.
      regex:
        type: string
        description: The regex for the custom field definition, if any.
        maxLength: 255
        minLength: 0
      order:
        type: integer
        description: The order of the custom field definition.
        format: int32
      possibleValues:
        type: array
        description: A list of possible custom field definition values.
        items:
          $ref: '#/definitions/CustomFieldDefinitionPossibleValuesDefinition'
  CustomFieldDefinitionPossibleValuesDefinition:
    type: object
    description: >-
      A generic definition to represent a possible value for a custom field
      definition.
    properties:
      id:
        type: string
        description: The unique identifier of this possible value.
        format: guid
      customFieldDefinitionId:
        type: string
        description: The custom field definition ID.
        format: guid
      name:
        type: string
        description: The name for this custom field possible value.
        maxLength: 255
        minLength: 0
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Custom Field Definitions
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
