openapi: 3.0.4
servers:
  - url: https://{environment}.pigello.io
    variables:
      environment:
        default: dev.api
        enum:
          - dev.api
          - api
security:
  - customer_id: []
    application_id: []
    service_id: []
    service_version_id: []
    client_ct: []
    client_object_id: []
    client_secret: []
paths:
  /sales/organization/{pk}/:
    get:
      responses:
        '200':
          description: Successful selection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sales.organization'
        '400':
          $ref: '#/components/responses/bad_query'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '404':
          $ref: '#/components/responses/not_found'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters:
        - name: pk
          in: path
          required: true
          schema:
            type: string
            writeOnly: true
      tags:
        - Organization
      summary: Get 'Organization'
    patch:
      responses:
        '200':
          description: Successful update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sales.organization'
        '400':
          $ref: '#/components/responses/invalid_object_payload'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters:
        - name: pk
          in: path
          required: true
          schema:
            type: string
            writeOnly: true
      tags:
        - Organization
      summary: Update 'Organization'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sales.organization'
    delete:
      responses:
        '204':
          description: Successful deletion
        '400':
          $ref: '#/components/responses/invalid_object_state'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters:
        - name: pk
          in: path
          required: true
          schema:
            type: string
            writeOnly: true
      tags:
        - Organization
      summary: Delete 'Organization'
  /sales/organization/:
    post:
      responses:
        '201':
          description: Successful creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sales.organization'
        '400':
          $ref: '#/components/responses/invalid_object_payload'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters: []
      tags:
        - Organization
      summary: Create 'Organization'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sales.organization'
  /sales/organization/list/:
    post:
      responses:
        '201':
          description: Successful bulk create/update
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/sales.organization'
        '400':
          $ref: '#/components/responses/invalid_list_payload'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters: []
      tags:
        - Organization
      summary: Bulk write 'Organization'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/sales.organization'
    get:
      responses:
        '200':
          description: Successful query
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/sales.organization'
        '400':
          $ref: '#/components/responses/bad_query'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/permission_denied'
        '404':
          $ref: '#/components/responses/not_found'
        '429':
          $ref: '#/components/responses/rate_limit_exceeded'
      parameters:
        - name: _jsonl
          in: query
          required: false
          schema:
            type: boolean
        - name: _order_by
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          example: field_a,-field_b
        - name: _page
          in: query
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            description: >-
              **Additional Validation Information:**


              This value must be set together with the following fields:
              `_page_size`
        - name: _page_size
          in: query
          required: false
          schema:
            type: integer
            format: int32
            description: |-
              **Additional Validation Information:**

              This value must be set together with the following fields: `_page`
        - name: _search
          in: query
          required: false
          schema:
            type: string
        - name: _slim
          in: query
          required: false
          schema:
            type: boolean
        - name: _statistics
          in: query
          required: false
          schema:
            type: boolean
        - name: customer_columns
          in: query
          required: false
          schema:
            type: array
            items: {}
        - name: global_realestates
          in: query
          required: false
          schema:
            type: array
            items: {}
        - name: global_segments
          in: query
          required: false
          schema:
            type: array
            items: {}
        - name: tags
          in: query
          required: false
          schema:
            type: array
            items: {}
        - name: created_at
          in: query
          required: false
          schema: {}
          description: >-
            Filter can be negated by adding a `!` to the end of the parameter
            name.






            **Additional operators:**


            Operator: `gt`, Supports negation (via `!`): `True`


            Operator: `gte`, Supports negation (via `!`): `True`


            Operator: `in`, Supports negation (via `!`): `True`


            Operator: `isnull`, Supports negation (via `!`): `True`


            Operator: `lt`, Supports negation (via `!`): `True`


            Operator: `lte`, Supports negation (via `!`): `True`
        - name: custom_id
          in: query
          required: false
          schema: {}
          description: >-
            Filter can be negated by adding a `!` to the end of the parameter
            name.






            **Additional operators:**


            Operator: `contains`, Supports negation (via `!`): `True`


            Operator: `endswith`, Supports negation (via `!`): `True`


            Operator: `icontains`, Supports negation (via `!`): `True`


            Operator: `iendswith`, Supports negation (via `!`): `True`


            Operator: `iexact`, Supports negation (via `!`): `True`


            Operator: `in`, Supports negation (via `!`): `True`


            Operator: `isnull`, Supports negation (via `!`): `True`


            Operator: `istartswith`, Supports negation (via `!`): `True`


            Operator: `startswith`, Supports negation (via `!`): `True`
        - name: id
          in: query
          required: false
          schema: {}
          description: >-
            Filter can be negated by adding a `!` to the end of the parameter
            name.






            **Additional operators:**


            Operator: `in`, Supports negation (via `!`): `True`


            Operator: `isnull`, Supports negation (via `!`): `True`
        - name: name
          in: query
          required: false
          schema: {}
          description: >-
            Filter can be negated by adding a `!` to the end of the parameter
            name.






            **Additional operators:**


            Operator: `contains`, Supports negation (via `!`): `True`


            Operator: `endswith`, Supports negation (via `!`): `True`


            Operator: `icontains`, Supports negation (via `!`): `True`


            Operator: `iendswith`, Supports negation (via `!`): `True`


            Operator: `iexact`, Supports negation (via `!`): `True`


            Operator: `in`, Supports negation (via `!`): `True`


            Operator: `isnull`, Supports negation (via `!`): `True`


            Operator: `istartswith`, Supports negation (via `!`): `True`


            Operator: `startswith`, Supports negation (via `!`): `True`
        - name: organization
          in: query
          required: false
          schema: {}
          description: >-
            Filter can be negated by adding a `!` to the end of the parameter
            name.






            **Additional operators:**


            Operator: `in`, Supports negation (via `!`): `True`


            Operator: `isnull`, Supports negation (via `!`): `True`
      tags:
        - Organization
      summary: List 'Organization'
components:
  securitySchemes:
    customer_id:
      type: apiKey
      in: header
      name: X-PIGELLO-CUSTOMER-ID
    application_id:
      type: apiKey
      in: header
      name: X-PIGELLO-APPLICATION-ID
    service_id:
      type: apiKey
      in: header
      name: X-PIGELLO-SERVICE-ID
    service_version_id:
      type: apiKey
      in: header
      name: X-PIGELLO-SERVICE-VERSION-ID
    client_ct:
      type: apiKey
      in: header
      name: X-PIGELLO-CLIENT-CT
    client_object_id:
      type: apiKey
      in: header
      name: X-PIGELLO-CLIENT-ENTITY
    client_secret:
      type: apiKey
      in: header
      name: X-PIGELLO-CLIENT-SECRET
  responses:
    not_found:
      description: Resource not found
    bad_query:
      description: Bad query/selection
    invalid_object_payload:
      description: Invalid payload
      content:
        application/json:
          schema: {}
    invalid_list_payload:
      description: Invalid payload
      content:
        application/json:
          schema:
            type: array
            items: {}
    invalid_object_state:
      description: Invalid state of object
      content:
        application/json:
          schema: {}
    permission_denied:
      description: Permission Denied
    unauthorized:
      description: Unauthorized
    rate_limit_exceeded:
      description: Rate limit exceeded
  schemas:
    sales.organization:
      properties:
        organization:
          type: object
          properties:
            id:
              type: string
              format: uuid
          nullable: true
          title: Organization
        customer_columns:
          readOnly: true
        created_at:
          type: string
          format: date-time
          nullable: false
          readOnly: true
        custom_id:
          type: string
          maxLength: 128
          nullable: true
        tags:
          readOnly: true
        id:
          type: string
          format: uuid
          nullable: false
          readOnly: true
          description: |-
            **Additional Validation Information:**

            Must be unique
        name:
          type: string
          maxLength: 255
          nullable: false
          description: |-
            **Additional Validation Information:**

            Must be unique
      type: object
      required:
        - id
        - name
      description: 'Content Type: `sales.organization`'
x-tagGroups: []
info:
  title: Sales
  version: 2.0.0
  description: The 'Sales' application of the Core API
