> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create integration exception logs

> Create integration exception logs, which will appear in the connection issue log screen of the user's integration.



## OpenAPI

````yaml /.openapi/v3/integrations/openapi.yaml post /integrations/{id}/logs
openapi: 3.1.0
info:
  title: Integrations
  version: 3.0.0
  contact:
    name: Sendcloud API Support
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: >-
    The Integrations API lets you manage some aspects of your integrations, and
    set and retrieve available shop order statuses.
servers:
  - url: https://panel.sendcloud.sc/api/v3
    description: Sendcloud Production
security: []
tags:
  - name: Integrations
    description: IntegrationsAPI
  - name: Exception logs
    description: Integration exception logs API
paths:
  /integrations/{id}/logs:
    parameters:
      - schema:
          type: integer
        name: id
        in: path
        required: true
        description: The id of the integration
    post:
      tags:
        - Exception logs
      summary: Create integration exception logs
      description: >-
        Create integration exception logs, which will appear in the connection
        issue log screen of the user's integration.
      operationId: sc-public-v3-integrations-post-create_integration_logs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/integration-log-create'
            examples:
              CreateIntegrationLog:
                summary: Create an integration log
                value:
                  base_url: https://example.com
                  full_url: https://example.com/order-note.json
                  method: POST
                  response_code: 495
                  response:
                    headers:
                      Cache-Control: max-age=3600
                      Content-Type: text/html; charset=utf-8
                      Connection: keep-alive
                    body: |
                      <!doctype html>
                      <html>
                       <head>
                       <title>SSL Certificate Error</title>
                       </head>
                       </html>
                  request:
                    headers:
                      Cache-Control: max-age=3600
                      Content-Type: text/html; charset=utf-8
                      Connection: keep-alive
                    payload:
                      order_note:
                        note: Success
                  created_at: '2023-03-01T02:02:00+01:00'
                  exception_type: requests.exceptions.SSLError
                  exception: An SSL error occurred
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/integration-log'
              examples:
                CreateIntegrationLog:
                  summary: Create an integration log
                  value:
                    data:
                      id: 123
                      integration_id: 123
                      base_url: https://example.com
                      full_url: https://example.com/order-note.json
                      method: POST
                      response_code: 495
                      response:
                        headers:
                          Cache-Control: max-age=3600
                          Content-Type: text/html; charset=utf-8
                          Connection: keep-alive
                        body: |
                          <!doctype html>
                          <html>
                           <head>
                           <title>SSL Certificate Error</title>
                           </head>
                           </html>
                      request:
                        headers:
                          Cache-Control: max-age=3600
                          Content-Type: text/html; charset=utf-8
                          Connection: keep-alive
                        payload:
                          order_note:
                            note: Success
                      created_at: '2023-03-01T02:02:00+01:00'
                      exception_type: requests.exceptions.SSLError
                      exception: An SSL error occurred
                      protected: false
                      additional_data: ''
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors'
              examples:
                ExtraFieldsNotPermitted:
                  summary: Extra fields are not permitted
                  value:
                    errors:
                      - status: 400
                        code: extra_forbidden
                        title: Extra Forbidden
                        detail: Extra inputs are not permitted
                        source:
                          pointer: body/unknown_field
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors'
              examples:
                IntegrationDoesNotExist:
                  summary: Integration does not exist
                  value:
                    errors:
                      - status: 404
                        code: not_found
                        title: Not Found
                        detail: >-
                          The Integration could not be found with the search
                          criteria given
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  schemas:
    integration-log-create:
      type: object
      title: Integration Log Create Object
      description: Request body for creating an integration exception log.
      properties:
        base_url:
          description: Base shop URL
          type: string
          example: https://example.com
          minLength: 1
        full_url:
          description: Full path to resource where error happened
          type:
            - string
            - 'null'
          example: https://example.com/order-note.json
        method:
          type:
            - string
            - 'null'
          description: HTTP method that caused an error
          example: POST
          default: ''
        response_code:
          type:
            - integer
            - 'null'
          description: Standard HTTP error code
          example: 495
          minimum: 0
        response:
          type:
            - object
            - 'null'
          title: Response object
          description: Response JSON containing response body and headers
          properties:
            headers:
              title: HTTP headers
              description: HTTP headers which were sent within a response
              type:
                - object
                - 'null'
            body:
              title: HTTP response body
              description: HTTP response body
              type:
                - string
                - object
                - 'null'
        request:
          type:
            - object
            - 'null'
          title: Request object
          description: Request JSON containing request body and headers
          properties:
            headers:
              title: HTTP headers
              description: HTTP headers which were sent within a request
              type:
                - object
                - string
                - 'null'
            payload:
              title: HTTP request body
              description: HTTP request body
              type:
                - object
                - string
                - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp indicating when an exception occurred. If not provided,
            the current date will be used.
          example: '2023-03-01T02:02:00+01:00'
        exception_type:
          type:
            - string
            - 'null'
          description: >-
            Internal field to store Python exception type. We use this field to
            suggest our users the ways how they can fix issues.
          example: requests.exceptions.SSLError
        exception:
          type:
            - string
            - 'null'
          title: Exception text
          description: Human readable description of exception
          example: An SSL error occurred
      required:
        - base_url
      additionalProperties: false
    integration-log:
      type: object
      title: Integration Log Object
      description: >-
        An integration exception log record containing information about a
        failed API request to a shop system.
      properties:
        id:
          type: integer
          title: ID
          description: ID of the log record
          minimum: 1
          example: 123
          readOnly: true
        integration_id:
          type:
            - integer
            - 'null'
          description: ID of the integration to which this log belongs
          minimum: 1
          example: 123
        base_url:
          description: Base shop URL
          type: string
          example: https://example.com
          minLength: 1
        full_url:
          description: Full path to resource where error happened
          type:
            - string
            - 'null'
          example: https://example.com/order-note.json
        method:
          type: string
          description: HTTP method that caused an error
          example: POST
        response_code:
          type:
            - integer
            - 'null'
          description: Standard HTTP error code
          example: 495
          minimum: 0
        response:
          type:
            - object
            - 'null'
          title: Response object
          description: Response JSON containing response body and headers
          properties:
            headers:
              title: HTTP headers
              description: HTTP headers which were sent within a response
              type:
                - object
                - 'null'
            body:
              title: HTTP response body
              description: HTTP response body
              type:
                - string
                - object
                - 'null'
        request:
          type:
            - object
            - 'null'
          title: Request object
          description: Request JSON containing request body and headers
          properties:
            headers:
              title: HTTP headers
              description: HTTP headers which were sent within a request
              type:
                - object
                - string
                - 'null'
            payload:
              title: HTTP request body
              description: HTTP request body
              type:
                - object
                - string
                - 'null'
        created_at:
          type: string
          format: date-time
          description: Timestamp indicating when an exception occurred
          example: '2023-03-01T02:02:00+01:00'
        exception_type:
          type:
            - string
            - 'null'
          description: >-
            Internal field to store Python exception type. We use this field to
            suggest our users the ways how they can fix issues.
          example: requests.exceptions.SSLError
        exception:
          type:
            - string
            - 'null'
          title: Exception text
          description: Human readable description of exception
          example: An SSL error occurred
        protected:
          type: boolean
          description: An indication whether or not request/response is obfuscated
          example: false
          readOnly: true
        additional_data:
          type:
            - object
            - string
          description: Additional data associated with the log entry
          default: ''
      required:
        - base_url
    errors:
      title: Errors
      type: object
      description: A standardized format for errors in JSON:API responses.
      properties:
        errors:
          type:
            - array
            - object
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/ErrorObject'
            required:
              - status
              - code
              - detail
    ErrorObject:
      title: Error
      type: object
      description: Error in a JSON:API error format
      properties:
        id:
          type: string
          description: A unique identifier for the error.
        links:
          type: object
          description: >-
            A set of hyperlinks that provide additional information about the
            error.
          properties:
            about:
              type: string
              description: A URL that provides additional information about the error.
        status:
          type: string
          format: int32
          description: The HTTP status code of the error.
          minLength: 1
        code:
          type: string
          description: A unique error code for the error, in snake case format.
          minLength: 1
          enum:
            - unknown_field
            - invalid
            - forbidden
            - invalid_choice
            - min_value
            - 'null'
            - not_found
            - required
            - not_a_list
            - non_field_errors
            - authentication_failed
            - validation_error
            - parcel_announcement_error
        title:
          type: string
          description: A short, human-readable summary of the error.
          minLength: 1
        detail:
          type: string
          description: A human-readable explanation of the error.
          minLength: 1
        source:
          type: object
          description: >-
            An object that identifies the source of the error within the request
            payload.
          properties:
            pointer:
              type: string
              description: >-
                A `JSON` pointer to the location of the error within the request
                payload.
            parameter:
              type: string
              description: The name of the `query` parameter that caused the error.
            header:
              type: string
              description: The name of the `header` parameter that caused the error.
        meta:
          type: object
          description: Additional metadata about the error.
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic
    OAuth2ClientCreds:
      type: oauth2
      description: >-
        OAuth2 is a standardized protocol for authorization that allows users to
        share their private resources stored on one site with another site
        without having to provide their credentials. OAuth2 Client Credentials
        Grant workflow. This workflow is typically used for server-to-server
        interactions that require authorization to access specific resources.
      flows:
        clientCredentials:
          tokenUrl: https://account.sendcloud.com/oauth2/token/
          scopes:
            api: Default OAuth scope required to access Sendcloud API.

````