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

# Send a roof to be built into an ESX

> Checks the roof, sends it to the export provider to be built, and records the export. The
answer comes before the build finishes: `202` with the export, usually `status: processing`,
and its warnings. Poll `GET /v1/esx-exports/{id}` until it is `ready`, then ask for the file
with `POST /v1/esx-exports/{id}/download`. Sending a roof is not charged; asking for its ESX
is, whether or not it has warnings, so look at `clean` and `major_warnings` first.

**Refused only for a critical problem.** The request's shape is validated first, then the
roof checks run, whether or not you checked the roof with `POST /v1/esx-exports/checks`. A
badly shaped request, or a roof with a critical problem (`severity: error`), answers
`422 validation_failed` and nothing is recorded. For a roof problem, `errors` lists every
problem found, critical or not, each with its `pointer`, `check`, `severity` and `detail`.
A critical problem can stop the later checks on its structure, so check again after
correcting it. Every other problem is a warning: the ESX is built anyway, and the export
lists each warning and what OSA did about it.

**One export per reference.** Within the key's environment (test or live), a `reference`
you have already used fails with `409 duplicate_export`, which names the existing export.
Send a corrected roof to that export with `POST /v1/esx-exports/{id}/versions`.

**If the export provider is unavailable.** The answer is `503 export_provider_unavailable`:
nothing was created or charged. Send the same request again, with the same
`Idempotency-Key`.

**Test keys.** An export sent with an `osa_test_` key is a test export (`test: true`),
built on a test system and never charged. A key sees only exports of its own environment.

**Retries.** `Idempotency-Key` is required. Retrying the same request (same method, path
and body) with the same key within 24 hours returns the same status code with the export's
current state, and creates nothing new. The same key with a different request fails with
`422 idempotency_key_reused`.




## OpenAPI

````yaml POST /v1/esx-exports
openapi: 3.1.0
info:
  title: OSA Partner API
  version: 1.0.0
  summary: Send claims to adjusters in the OSA app and follow their acceptance.
  description: >
    The OSA Partner API lets a partner's claims system invite adjusters to its
    organisation,

    send them claims, and see whether each claim was accepted or rejected in the
    OSA app.


    **Conventions**

    - All requests and responses are JSON (`application/json`); errors use RFC
    9457 problem
      details (`application/problem+json`).
    - Field names are `snake_case`. Enum values are lowercase (for example
    `flood`,
      `pending_acceptance`), except US state and territory codes, which are the standard
      two-letter USPS codes, and flood zones, which are written as FEMA writes them (for
      example `AE`).
    - Enums are **open**: new values may be added to responses at any time, so
    your code must
      tolerate values it doesn't recognise.
    - Additive changes (new endpoints, new optional request fields, new response
    fields, new
      enum values) are made within `/v1`. Breaking changes go to a new version.
    - Requests are strict: an unknown or misspelled body field or query
    parameter is
      rejected with `422 validation_failed`, so typos can't be silently ignored.
    - Your own claim id (`external_id`) is stored on every claim and returned on
    every claim
      response, so you can match claims without keeping OSA's id.
    - Timestamps are RFC 3339 date-times in UTC. Dates that are calendar dates
    (such as the
      date of loss) are `YYYY-MM-DD` and are never converted between time zones.

    **Keys.** Every request except `GET /v1/health` needs an API key sent as

    `Authorization: Bearer <key>`. Live keys start with `osa_live_`; test keys
    start with

    `osa_test_` and only reach test claims and test accounts.
  contact:
    name: OSA API support
    email: info@osaconnection.com
    url: https://docs.osaconnection.com
servers:
  - url: https://api.osaconnection.com
    description: >-
      Production. Live and test keys both use this host; the key decides which
      data you reach.
security:
  - apiKey: []
tags:
  - name: Claims
    description: >
      Send claims to adjusters, offer them to another adjuster, and poll for
      acceptance.

      `/v1/claims` is always the claims you sent through the API.
  - name: Members
    description: >-
      Invite people to your organisation by their OSAID, with a role, and track
      their invitations.
  - name: ESX exports
    description: >
      Send measurements and get an Xactimate ESX back: check a roof, send it to
      be built, poll

      until it is ready, then ask for the file.
  - name: Account
    description: Check which partner and permissions your API key carries.
  - name: Health
    description: Service availability. No key needed.
paths:
  /v1/esx-exports:
    post:
      tags:
        - ESX exports
      summary: Send a roof to be built into an ESX
      description: >
        Checks the roof, sends it to the export provider to be built, and
        records the export. The

        answer comes before the build finishes: `202` with the export, usually
        `status: processing`,

        and its warnings. Poll `GET /v1/esx-exports/{id}` until it is `ready`,
        then ask for the file

        with `POST /v1/esx-exports/{id}/download`. Sending a roof is not
        charged; asking for its ESX

        is, whether or not it has warnings, so look at `clean` and
        `major_warnings` first.


        **Refused only for a critical problem.** The request's shape is
        validated first, then the

        roof checks run, whether or not you checked the roof with `POST
        /v1/esx-exports/checks`. A

        badly shaped request, or a roof with a critical problem (`severity:
        error`), answers

        `422 validation_failed` and nothing is recorded. For a roof problem,
        `errors` lists every

        problem found, critical or not, each with its `pointer`, `check`,
        `severity` and `detail`.

        A critical problem can stop the later checks on its structure, so check
        again after

        correcting it. Every other problem is a warning: the ESX is built
        anyway, and the export

        lists each warning and what OSA did about it.


        **One export per reference.** Within the key's environment (test or
        live), a `reference`

        you have already used fails with `409 duplicate_export`, which names the
        existing export.

        Send a corrected roof to that export with `POST
        /v1/esx-exports/{id}/versions`.


        **If the export provider is unavailable.** The answer is `503
        export_provider_unavailable`:

        nothing was created or charged. Send the same request again, with the
        same

        `Idempotency-Key`.


        **Test keys.** An export sent with an `osa_test_` key is a test export
        (`test: true`),

        built on a test system and never charged. A key sees only exports of its
        own environment.


        **Retries.** `Idempotency-Key` is required. Retrying the same request
        (same method, path

        and body) with the same key within 24 hours returns the same status code
        with the export's

        current state, and creates nothing new. The same key with a different
        request fails with

        `422 idempotency_key_reused`.
      operationId: createEsxExport
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        description: The roof, the property it is on, and your own id for the order.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EsxExportCreate'
            examples:
              minimal:
                summary: Only the required fields
                value:
                  reference: ORDER-1042
                  input:
                    type: roof
                    format: osa-roof/1
                    plan:
                      units: ft
                      y_axis: up
                      north_deg: 0
                    structures:
                      - id: house
                        points:
                          - id: a
                            x: -20
                            'y': -15
                          - id: b
                            x: 20
                            'y': -15
                          - id: c
                            x: 20
                            'y': 15
                          - id: d
                            x: -20
                            'y': 15
                          - id: e
                            x: -20
                            'y': 0
                          - id: f
                            x: 20
                            'y': 0
                        edges:
                          - id: eave-s
                            from: a
                            to: b
                            type: eave
                          - id: eave-n
                            from: c
                            to: d
                            type: eave
                          - id: ridge
                            from: e
                            to: f
                            type: ridge
                          - id: rake-sw
                            from: a
                            to: e
                            type: rake
                          - id: rake-se
                            from: b
                            to: f
                            type: rake
                          - id: rake-ne
                            from: c
                            to: f
                            type: rake
                          - id: rake-nw
                            from: d
                            to: e
                            type: rake
                        faces:
                          - id: south
                            edges:
                              - eave-s
                              - rake-se
                              - ridge
                              - rake-sw
                            pitch: 6
                            eave_height_ft: 9
                          - id: north
                            edges:
                              - eave-n
                              - rake-nw
                              - ridge
                              - rake-ne
                            pitch: 6
                            eave_height_ft: 9
                  property:
                    street: 740 Canyon View Drive
                    city: Lehi
                    state: UT
                    zip: '84043'
                    lat: 40.4358
                    lon: -111.8683
              full:
                summary: With a claim number, the user who asked and your own metadata
                value:
                  reference: ORDER-1042
                  input:
                    type: roof
                    format: osa-roof/1
                    plan:
                      units: ft
                      y_axis: up
                      north_deg: 0
                    structures:
                      - id: house
                        points:
                          - id: a
                            x: -20
                            'y': -15
                          - id: b
                            x: 20
                            'y': -15
                          - id: c
                            x: 20
                            'y': 15
                          - id: d
                            x: -20
                            'y': 15
                          - id: e
                            x: -20
                            'y': 0
                          - id: f
                            x: 20
                            'y': 0
                        edges:
                          - id: eave-s
                            from: a
                            to: b
                            type: eave
                          - id: eave-n
                            from: c
                            to: d
                            type: eave
                          - id: ridge
                            from: e
                            to: f
                            type: ridge
                          - id: rake-sw
                            from: a
                            to: e
                            type: rake
                          - id: rake-se
                            from: b
                            to: f
                            type: rake
                          - id: rake-ne
                            from: c
                            to: f
                            type: rake
                          - id: rake-nw
                            from: d
                            to: e
                            type: rake
                        faces:
                          - id: south
                            edges:
                              - eave-s
                              - rake-se
                              - ridge
                              - rake-sw
                            pitch: 6
                            eave_height_ft: 9
                          - id: north
                            edges:
                              - eave-n
                              - rake-nw
                              - ridge
                              - rake-ne
                            pitch: 6
                            eave_height_ft: 9
                  property:
                    street: 740 Canyon View Drive
                    city: Lehi
                    state: UT
                    zip: '84043'
                    lat: 40.4358
                    lon: -111.8683
                  claim_number: FL-2026-0091832
                  end_user:
                    id: user-5521
                    email: estimator@example.com
                  metadata:
                    branch: north
                    job_type: reroof
      responses:
        '202':
          description: >
            The roof was sent to the export provider and recorded. The export is
            usually `processing`;

            if the provider refused the file outright, it is already `failed`
            with reason

            `build_refused`. A retry with the same `Idempotency-Key` returns
            `202` again with the

            export's current state, which by then may be `processing`, `ready`
            or `failed`.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EsxExport'
              examples:
                clean:
                  summary: Received, with no warnings
                  value:
                    id: 3f0c8a6e-5b1d-4c0e-9a77-2f6d1e4b8c90
                    reference: ORDER-1042
                    test: false
                    status: processing
                    failure: null
                    clean: true
                    major_warnings: 0
                    minor_warnings: 0
                    warnings: []
                    provider_messages: []
                    version: 1
                    created_at: '2026-12-01T15:42:10Z'
                    updated_at: '2026-12-01T15:42:13Z'
                    ready_at: null
                    first_downloaded_at: null
                    claim_number: null
                    end_user: null
                    metadata: {}
                warning:
                  summary: Received, to be built with a warning
                  value:
                    id: 3f0c8a6e-5b1d-4c0e-9a77-2f6d1e4b8c90
                    reference: ORDER-1042
                    test: false
                    status: processing
                    failure: null
                    clean: false
                    major_warnings: 0
                    minor_warnings: 1
                    warnings:
                      - pointer: /input/structures/0/points/4
                        check: 5
                        severity: minor
                        detail: >-
                          point `e`, the faces that meet there put it at
                          different heights (1.7 in apart); built at their
                          average, 16 ft 6.9 in
                    provider_messages: []
                    version: 1
                    created_at: '2026-12-01T15:42:10Z'
                    updated_at: '2026-12-01T15:42:13Z'
                    ready_at: null
                    first_downloaded_at: null
                    claim_number: FL-2026-0091832
                    end_user:
                      id: user-5521
                      email: estimator@example.com
                    metadata:
                      branch: north
                      job_type: reroof
        '400':
          $ref: '#/components/responses/MalformedRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/DuplicateExport'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '422':
          $ref: '#/components/responses/EsxExportUnprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ExportProviderUnavailable'
      security:
        - apiKey:
            - esx-exports:create
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: >
        A unique value your system generates for each operation, such as a UUID.
        Reuse the same

        value only when retrying the same request. The key is matched with a
        fingerprint of the

        whole request: method, path and body. For 24 hours, a retry of the same
        request with the

        same key returns the same status code with the resource's current state,
        and creates

        nothing new; the same key with a different request fails with

        `422 idempotency_key_reused`.
      schema:
        type: string
        minLength: 1
        maxLength: 255
      examples:
        uuid:
          summary: A UUID per operation
          value: 7c4e2b9a-1f3d-4e8a-b6c5-0d9e8f7a6b5c
  schemas:
    EsxExportCreate:
      type: object
      description: >
        A roof to build into an ESX, with the property it belongs to. The check
        call takes the

        same body.
      additionalProperties: false
      required:
        - reference
        - input
        - property
      properties:
        reference:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^\S(.*\S)?$
          description: >
            Your own id for the order. One export per reference, in the key's
            environment (test

            or live): a second export with a reference you have already used is
            refused with

            `409 duplicate_export`; send a corrected roof as a new version of
            the existing

            export instead. Returned on the export, never changed. No leading or
            trailing

            whitespace.
          examples:
            - ORDER-1042
        input:
          $ref: '#/components/schemas/RoofInput'
        property:
          $ref: '#/components/schemas/EsxExportProperty'
        claim_number:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^\S(.*\S)?$
          description: >
            The carrier's claim number, when there is one. Returned on the
            export. No leading or

            trailing whitespace.
          examples:
            - FL-2026-0091832
        end_user:
          $ref: '#/components/schemas/EsxExportEndUser'
        metadata:
          $ref: '#/components/schemas/EsxExportMetadata'
    EsxExport:
      type: object
      description: >
        An export: the roof you sent, on its way to becoming an ESX. `warnings`,
        `major_warnings`,

        `minor_warnings`, `clean`, `provider_messages` and `failure` describe
        the latest version

        only; `version` says which.
      required:
        - id
        - reference
        - test
        - status
        - failure
        - clean
        - major_warnings
        - minor_warnings
        - warnings
        - provider_messages
        - version
        - created_at
        - updated_at
        - ready_at
        - first_downloaded_at
        - claim_number
        - end_user
        - metadata
      properties:
        id:
          type: string
          format: uuid
          description: OSA's id for the export.
        reference:
          type: string
          description: Your own id for the order.
        test:
          type: boolean
          description: >
            `true` for a test export, one sent with a test key: built on a test
            system and never

            charged. The value never changes. A key sees only exports of its own
            environment, so

            the field matters only if you store exports from both keys.
        status:
          type: string
          description: >
            `processing`: received and on its way through the build. `ready`:
            the ESX can be

            asked for. `failed`: not built; `failure` says why. Open list: new
            values may be

            added; treat an unknown value as `processing`.
          enum:
            - processing
            - ready
            - failed
        failure:
          $ref: '#/components/schemas/EsxExportFailure'
        clean:
          type: boolean
          description: '`true` when the latest version has no warnings.'
        major_warnings:
          type: integer
          minimum: 0
          description: The exact number of `major` warnings on the latest version.
        minor_warnings:
          type: integer
          minimum: 0
          description: The exact number of `minor` warnings on the latest version.
        warnings:
          type: array
          description: >
            The latest version's warnings, each with its severity and what OSA
            did about it. At

            most 100; the two counts are exact. When there are more than 100, it
            holds the

            `major` ones first, then the `minor` ones, in check order. Never
            contains a problem of

            severity `error`.
          maxItems: 100
          items:
            $ref: '#/components/schemas/EsxExportProblem'
        provider_messages:
          type: array
          description: >
            What the export provider said about the latest version's file when
            it took it.

            Usually empty. Free text for people, in the export provider's own
            words, which may

            name the provider's products; do not parse it. It does not affect
            `clean`.
          items:
            type: string
        version:
          type: integer
          minimum: 1
          description: >-
            The version of the roof the export is built from. `1` until you send
            a corrected roof.
        created_at:
          type: string
          format: date-time
          description: When the export was created.
        updated_at:
          type: string
          format: date-time
          description: >
            When the export last changed: it moves when the export is created,
            when its `status`

            changes, when a new version is accepted, and when its ESX is first
            asked for. This is

            the field `updated_since` filters on.
        ready_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the latest version became `ready`; `null` until then.
        first_downloaded_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the ESX was first asked for; `null` until then.
        claim_number:
          type:
            - string
            - 'null'
          description: The carrier's claim number, as you sent it; `null` if you sent none.
        end_user:
          type:
            - object
            - 'null'
          description: >-
            Who in your system asked for the export, as you sent it; `null` if
            you sent none.
          properties:
            id:
              type: string
              description: Your own id for the user.
            email:
              type: string
              description: The user's email address.
        metadata:
          type: object
          description: Your own key-value pairs, as you sent them; empty if you sent none.
          additionalProperties:
            type: string
    RoofInput:
      type: object
      description: >
        A roof, in OSA's roof format version 1 (`osa-roof/1`): one or more roofs
        as seen from above,

        with enough to build each in three dimensions. You are responsible for
        the roof being

        right. OSA checks it: a roof that cannot be built is refused with exact
        reasons, and any

        other problem is a warning, with the roof built anyway. Lengths and
        areas are not sent: OSA

        works them out from the points and the faces' pitches. Ids everywhere
        are 1 to 64 letters,

        digits, `-`, `_` or `.`, unique within their list; problems name them.
      additionalProperties: false
      required:
        - type
        - format
        - plan
        - structures
      properties:
        type:
          type: string
          description: What the input describes. Always `roof`.
          enum:
            - roof
        format:
          type: string
          description: The format and version of the input. Always `osa-roof/1`.
          enum:
            - osa-roof/1
        plan:
          $ref: '#/components/schemas/RoofPlan'
        structures:
          type: array
          description: >
            The separate buildings, such as a house and a detached garage. Each
            is a roof that

            touches no other structure's roof. Most roofs have one. At most 10.
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/RoofStructure'
      examples:
        - type: roof
          format: osa-roof/1
          plan:
            units: ft
            y_axis: up
            north_deg: 0
          structures:
            - id: house
              points:
                - id: a
                  x: -20
                  'y': -15
                - id: b
                  x: 20
                  'y': -15
                - id: c
                  x: 20
                  'y': 15
                - id: d
                  x: -20
                  'y': 15
                - id: e
                  x: -20
                  'y': 0
                - id: f
                  x: 20
                  'y': 0
              edges:
                - id: eave-s
                  from: a
                  to: b
                  type: eave
                - id: eave-n
                  from: c
                  to: d
                  type: eave
                - id: ridge
                  from: e
                  to: f
                  type: ridge
                - id: rake-sw
                  from: a
                  to: e
                  type: rake
                - id: rake-se
                  from: b
                  to: f
                  type: rake
                - id: rake-ne
                  from: c
                  to: f
                  type: rake
                - id: rake-nw
                  from: d
                  to: e
                  type: rake
              faces:
                - id: south
                  edges:
                    - eave-s
                    - rake-se
                    - ridge
                    - rake-sw
                  pitch: 6
                  eave_height_ft: 9
                - id: north
                  edges:
                    - eave-n
                    - rake-nw
                    - ridge
                    - rake-ne
                  pitch: 6
                  eave_height_ft: 9
    EsxExportProperty:
      type: object
      description: The property the roof is on.
      additionalProperties: false
      required:
        - street
        - city
        - state
        - zip
        - lat
        - lon
      properties:
        street:
          type: string
          minLength: 1
          maxLength: 100
          description: Street address, including any unit number.
          examples:
            - 740 Canyon View Drive
        city:
          type: string
          minLength: 1
          maxLength: 60
          description: City.
          examples:
            - Lehi
        state:
          $ref: '#/components/schemas/State'
        zip:
          $ref: '#/components/schemas/Zip'
        lat:
          type: number
          minimum: -90
          maximum: 90
          description: Latitude of the property, in degrees.
          examples:
            - 40.4358
        lon:
          type: number
          minimum: -180
          maximum: 180
          description: Longitude of the property, in degrees.
          examples:
            - -111.8683
    EsxExportEndUser:
      type: object
      description: >
        Who in your system asked for the export, for your own records. Send at
        least one of

        `id` and `email`. Returned on the export as sent.
      additionalProperties: false
      minProperties: 1
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 100
          description: Your own id for the user.
        email:
          $ref: '#/components/schemas/Email'
    EsxExportMetadata:
      type: object
      description: >
        Your own key-value pairs, returned on the export as sent. Up to 20 keys,
        each 1 to 40

        characters of `a` to `z`, `0` to `9` and `_`; each value text of up to
        200 characters.
      maxProperties: 20
      propertyNames:
        pattern: ^[a-z0-9_]{1,40}$
      additionalProperties:
        type: string
        maxLength: 200
      examples:
        - branch: north
          job_type: reroof
    EsxExportFailure:
      type:
        - object
        - 'null'
      description: >
        Why the latest version was not built. `null` unless `status` is
        `failed`.
      required:
        - reason
        - detail
      properties:
        reason:
          type: string
          description: >
            `build_refused`: the export provider refused the file; correct the
            roof and send a new

            version. `build_failed`: the provider took the file and could not
            build it, or a

            corrected version could not be sent to it; send a new version, or
            contact OSA.

            `build_timeout`: not ready 10 minutes after it was sent, once the
            export provider

            confirms the build has not finished; send the same roof as a new
            version. Open list: new

            values may be added; treat an unknown value as `build_failed`.
          enum:
            - build_refused
            - build_failed
            - build_timeout
        detail:
          type: string
          description: >
            What happened: free text for people, not for parsing; use `reason`.
            For

            `build_refused`, it is in the export provider's own words, which may
            name the

            provider's products.
    EsxExportProblem:
      type: object
      description: >
        One problem with a roof: where it is, which check found it, how serious
        it is and what

        it means. The same shape in the check call's answer and an export's
        `warnings`.
      required:
        - pointer
        - check
        - severity
        - detail
      properties:
        pointer:
          type: string
          description: >-
            JSON Pointer to the place in the request, for example
            `/input/structures/0/faces/8`.
        check:
          type: integer
          minimum: 1
          description: >
            The number of the check that found the problem: 1, the request
            matches the roof

            format; 2, edges and faces refer to things that exist and faces
            close; 3, how edges

            sit on faces; 4, eaves and slope direction; 5, heights where faces
            meet; 6, heights

            given for every section; 7, the property's ZIP and location. More
            checks may be

            added.
        severity:
          type: string
          description: >
            `error`: critical, the roof cannot be built and is refused. `major`
            and `minor`:

            warnings; the roof is built and `detail` says what OSA did. Open
            list: new values

            may be added; treat an unknown value as `major`.
          enum:
            - error
            - major
            - minor
        detail:
          type: string
          description: >-
            What is wrong, naming your own ids, and for a warning what OSA did
            about it.
    Problem:
      type: object
      description: >
        An RFC 9457 problem details object. Match on `code`, which is stable;
        `title` and

        `detail` are for people and may change. Quote `request_id` when
        contacting support.
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri
          description: A link to this error's documentation.
        title:
          type: string
          description: A short summary of the error.
        status:
          type: integer
          description: The HTTP status code.
        detail:
          type: string
          description: What went wrong in this request.
        code:
          type: string
          description: >
            The stable error code. `malformed_request` (400); `invalid_key`
            (401);

            `insufficient_scope`, `not_in_plan` (403); `not_found` (404);
            `duplicate_claim`,

            `claim_already_accepted`, `already_member`, `invitation_pending`,
            `duplicate_export`,

            `export_not_ready` (409); `payload_too_large` (413);
            `validation_failed`,

            `idempotency_key_reused`, `unknown_osaid`, `adjuster_not_a_member`,

            `adjuster_not_accepting`, `environment_mismatch` (422);
            `rate_limited` (429);

            `internal_error` (500); `export_provider_unavailable` (503). Open
            list:

            new values may be added; treat an unknown value as an error you
            don't specifically

            handle, by its HTTP `status`.
          enum:
            - malformed_request
            - invalid_key
            - insufficient_scope
            - not_in_plan
            - not_found
            - duplicate_claim
            - claim_already_accepted
            - already_member
            - invitation_pending
            - duplicate_export
            - export_not_ready
            - payload_too_large
            - validation_failed
            - idempotency_key_reused
            - unknown_osaid
            - adjuster_not_a_member
            - adjuster_not_accepting
            - environment_mismatch
            - rate_limited
            - internal_error
            - export_provider_unavailable
        request_id:
          type: string
          description: The id of this request. Quote it when contacting support.
        errors:
          type: array
          description: For `validation_failed`, each invalid field, parameter or header.
          items:
            type: object
            description: >-
              One problem. Exactly one of `pointer`, `parameter` or `header`
              says where.
            required:
              - detail
            properties:
              pointer:
                type: string
                description: >-
                  JSON Pointer to a body field, for example `/loss/date`. Empty
                  for the whole body.
              parameter:
                type: string
                description: The name of a query or path parameter, for example `limit`.
              header:
                type: string
                description: The name of a request header, for example `Idempotency-Key`.
              detail:
                type: string
                description: What is wrong with it.
              check:
                type: integer
                description: For a roof problem, the number of the check.
              severity:
                type: string
                description: >
                  For a roof problem, how serious it is; a request is refused
                  only when at least

                  one is `error`. Open list: new values may be added; treat an
                  unknown value as

                  `major`.
                enum:
                  - error
                  - major
                  - minor
        existing_claim_id:
          type: string
          format: uuid
          description: >-
            For `duplicate_claim`, the id of the claim that already exists.
            Always a claim your key can read.
        existing_claim_url:
          type: string
          format: uri
          description: >-
            For `duplicate_claim`, the API link to the claim that already
            exists. Always a claim your key can read.
        existing_export_id:
          type: string
          format: uuid
          description: >-
            For `duplicate_export`, the id of the export that already exists.
            Always an export your key can read.
        existing_export_url:
          type: string
          format: uri
          description: >-
            For `duplicate_export`, the API link to the export that already
            exists. Always an export your key can read.
    RoofPlan:
      type: object
      description: >
        How to read every `x` and `y` in the roof. Heights are always in feet,
        whatever the plan

        units; fields that carry a height end in `_ft`. The origin can be
        anywhere: OSA moves it

        to the middle of each structure.
      additionalProperties: false
      required:
        - units
        - y_axis
      properties:
        units:
          type: string
          description: >
            `ft`: `x` and `y` are feet. `px`: `x` and `y` are pixels of an
            image, and

            `feet_per_pixel` is required.
          enum:
            - ft
            - px
        feet_per_pixel:
          type: number
          description: >
            Horizontal (plan) feet per pixel, one scale for the whole plan.
            Required when `units`

            is `px`, and not allowed otherwise; a roof that breaks this has a
            critical problem of

            check 1 and is refused. More than 0, at most 10.
          exclusiveMinimum: 0
          maximum: 10
        y_axis:
          type: string
          description: >
            `up`: `y` grows upward on the drawing, as on a map. `down`: `y`
            grows downward, as

            in an image.
          enum:
            - up
            - down
        north_deg:
          type: number
          description: >
            The compass direction the top of the drawing faces, in degrees
            clockwise from north:

            at least 0, less than 360. Leave it out for 0, which means the top
            of the drawing is

            north, as in most aerial imagery.
          minimum: 0
          exclusiveMaximum: 360
    RoofStructure:
      type: object
      description: >
        One building's roof: its corners (`points`), the lines between them
        (`edges`) and its

        flat surfaces (`faces`). Give heights one way per structure: none at all
        (the roof is

        built with its lowest eave at 0 ft, so Xactimate gets a correctly shaped
        roof but no

        height above the ground), `eave_height_ft` on faces (recommended: at
        least one face of

        each section of roof, where a section is a group of faces that share
        points), or `z_ft`

        on every point.
      additionalProperties: false
      required:
        - id
        - points
        - edges
        - faces
      properties:
        id:
          type: string
          description: Your name for the structure, unique in the roof.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - house
        name:
          type: string
          description: A label, such as "Detached garage".
          minLength: 1
          maxLength: 100
          examples:
            - Detached garage
        points:
          type: array
          description: >-
            Every corner of the roof as seen from above. At least 3, at most
            1,000.
          minItems: 3
          maxItems: 1000
          items:
            $ref: '#/components/schemas/RoofPoint'
        edges:
          type: array
          description: >-
            Every line between two points that bounds a face. At least 3, at
            most 2,000.
          minItems: 3
          maxItems: 2000
          items:
            $ref: '#/components/schemas/RoofEdge'
        faces:
          type: array
          description: Every flat surface of the roof. At least 1, at most 300.
          minItems: 1
          maxItems: 300
          items:
            $ref: '#/components/schemas/RoofFace'
        features:
          $ref: '#/components/schemas/RoofFeatures'
    State:
      type: string
      description: >
        Two-letter USPS code: the 50 states, `DC`, and the US territories `AS`
        (American Samoa),

        `GU` (Guam), `MP` (Northern Mariana Islands), `PR` (Puerto Rico) and
        `VI` (US Virgin

        Islands).
      enum:
        - AL
        - AK
        - AZ
        - AR
        - CA
        - CO
        - CT
        - DE
        - DC
        - FL
        - GA
        - HI
        - ID
        - IL
        - IN
        - IA
        - KS
        - KY
        - LA
        - ME
        - MD
        - MA
        - MI
        - MN
        - MS
        - MO
        - MT
        - NE
        - NV
        - NH
        - NJ
        - NM
        - NY
        - NC
        - ND
        - OH
        - OK
        - OR
        - PA
        - RI
        - SC
        - SD
        - TN
        - TX
        - UT
        - VT
        - VA
        - WA
        - WV
        - WI
        - WY
        - AS
        - GU
        - MP
        - PR
        - VI
      examples:
        - FL
    Zip:
      type: string
      description: Five-digit ZIP code, optionally ZIP+4.
      pattern: ^\d{5}(-\d{4})?$
      examples:
        - '33606'
        - 33606-1234
    Email:
      type: string
      format: email
      maxLength: 255
      description: An email address.
      examples:
        - maria.delgado@example.com
    RoofPoint:
      type: object
      description: >
        A corner of the roof as seen from above. A point is one place in three
        dimensions: where

        two parts of a roof pass over the same spot at different heights, such
        as a porch roof

        meeting the wall below a higher eave, that spot needs two points, one
        for each roof.
      additionalProperties: false
      required:
        - id
        - x
        - 'y'
      properties:
        id:
          type: string
          description: The point's id, unique in the structure.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - a
        x:
          type: number
          description: Position across the drawing, in plan units.
        'y':
          type: number
          description: >-
            Position along the drawing, in plan units, in the direction `y_axis`
            gives.
        z_ft:
          type: number
          description: >
            Height above the ground, in feet, from -50 to 300. Either every
            point in the

            structure has one or none does; a structure with some has a critical
            problem of

            check 1 and is refused. With a height on every point, each point is
            built as you gave

            it; a face that is then not flat or does not match its pitch is a
            check 5 warning.

            Nothing is averaged in that case.
          minimum: -50
          maximum: 300
    RoofEdge:
      type: object
      description: >
        A line between two points that bounds a face. Lengths are not sent: OSA
        works out each

        edge's true length from the points and the faces' pitches.
      additionalProperties: false
      required:
        - id
        - from
        - to
        - type
      properties:
        id:
          type: string
          description: The edge's id, unique in the structure.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - eave-s
        from:
          type: string
          description: The id of one of the edge's two points. Order does not matter.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - a
        to:
          type: string
          description: The id of the edge's other point, different from `from`.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - b
        type:
          type: string
          description: >
            What the edge is. `eave`: the low, level edge of a face, where water
            runs off.

            `rake`: the sloped outer edge at a gable end. `ridge`: where two
            faces meet at the

            top. `hip`: where two faces meet at an outward corner, sloping down.
            `valley`: where

            two faces meet at an inward corner, sloping down. `apron_flashing`:
            where the top of

            a face meets a wall that rises above it (also called headwall).
            `step_flashing`:

            where the side of a face runs along a wall that rises beside it
            (also called

            sidewall). `pitch_break`: where a face changes pitch without a
            ridge, as on a

            gambrel or mansard roof. `unclassified`: an edge whose kind is not
            known; allowed,

            but it adds nothing to the estimate.
          enum:
            - eave
            - rake
            - ridge
            - hip
            - valley
            - apron_flashing
            - step_flashing
            - pitch_break
            - unclassified
          examples:
            - eave
        overhang_ft:
          type: number
          description: >
            How far the roof overhangs the wall, in feet, from 0 to 10. Only on
            an `eave` or a

            `rake`; on any other edge it is a critical problem of check 1, and
            the roof is

            refused.
          minimum: 0
          maximum: 10
    RoofFace:
      type: object
      description: >
        A flat surface of the roof. Every point of a face should lie on one
        plane: the plane its

        pitch, slope direction and height give it. A face slopes down toward its
        `eave` edges,

        at right angles to them; all of a face's eaves should be parallel and on
        the same side

        of it. A face with eaves on opposite sides is built sloping toward its
        longest group of

        eaves, with a warning. Areas are not sent: OSA works out each face's
        true area.
      additionalProperties: false
      required:
        - id
        - edges
        - pitch
      properties:
        id:
          type: string
          description: The face's id, unique in the structure.
          pattern: ^[A-Za-z0-9._-]{1,64}$
          examples:
            - south
        edges:
          type: array
          description: >
            The ids of the edges around the face, in order around it, at least 3
            and at most

            200. Each consecutive pair shares a point and the last joins the
            first.
          minItems: 3
          maxItems: 200
          items:
            type: string
            description: An edge id in the structure.
            pattern: ^[A-Za-z0-9._-]{1,64}$
        pitch:
          type: number
          description: >
            Rise in inches per 12 inches of run, as a number: `6` for 6/12,
            `6.5` for 6.5/12,

            `0` for flat. At most 24.
          minimum: 0
          maximum: 24
          examples:
            - 6
        eave_height_ft:
          type: number
          description: >
            Height above the ground of the face's eave edges, in feet, from -50
            to 300. Faces

            that share a ridge, hip or valley take their heights from each
            other, so one face per

            section of roof is enough. Where two faces both carry one, they
            should agree with

            the geometry; where faces disagree on a shared point's height by
            more than 1 inch,

            the point is built at their average, with a warning.
          minimum: -50
          maximum: 300
          examples:
            - 9
        low_edge:
          type: string
          description: >
            The id of the edge the face slopes down toward. Should be sent when
            the face has no

            `eave` edge and a pitch above 0, such as the upper face of a gambrel
            above its

            `pitch_break`. Without it the face is built from the faces around
            it, with a major

            warning.
          pattern: ^[A-Za-z0-9._-]{1,64}$
    RoofFeatures:
      type: object
      description: >
        Counts of things on the structure's roof that the estimate needs and the
        drawing does not

        show. Each is a whole number from 1 to 100,000; leave out what is not
        there, and leave

        out `features` if nothing is. They apply to the structure's whole roof;
        they cannot be

        placed on one face.
      additionalProperties: false
      minProperties: 1
      properties:
        pipe_jack_vents:
          type: integer
          description: Plumbing vent pipes.
          minimum: 1
          maximum: 100000
        exhaust_vents:
          type: integer
          description: Exhaust vents.
          minimum: 1
          maximum: 100000
        attic_vents:
          type: integer
          description: Attic vents.
          minimum: 1
          maximum: 100000
        reflective_tubes:
          type: integer
          description: Tubular skylights.
          minimum: 1
          maximum: 100000
        satellite_dishes:
          type: integer
          description: Satellite dishes.
          minimum: 1
          maximum: 100000
        ac_units:
          type: integer
          description: Air conditioning units on the roof.
          minimum: 1
          maximum: 100000
        skylights:
          type: integer
          description: Skylights.
          minimum: 1
          maximum: 100000
        roofing_panels:
          type: integer
          description: Roofing panels.
          minimum: 1
          maximum: 100000
        gutter_ft:
          type: integer
          description: Gutter, in whole feet.
          minimum: 1
          maximum: 100000
  headers:
    RequestId:
      description: >
        The id of this request. Quote it to OSA support. On error responses it
        equals

        `request_id` in the body.
      required: true
      schema:
        type: string
      examples:
        request_id:
          summary: A request id
          value: 7f3e9a1c2b4d6e8f0a1b3c5d7e9f1a2b
    RetryAfter:
      description: Seconds to wait before retrying.
      required: true
      schema:
        type: integer
        minimum: 1
      examples:
        seconds:
          summary: Retry in 12 seconds
          value: 12
  responses:
    MalformedRequest:
      description: The body isn't valid JSON or can't be read (`malformed_request`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            malformed_request:
              summary: malformed_request
              value:
                type: https://docs.osaconnection.com/errors#malformed_request
                title: Malformed request
                status: 400
                detail: The request body isn't valid JSON.
                code: malformed_request
                request_id: 0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d
    Unauthorized:
      description: >
        The key is missing, malformed, unknown, revoked or expired
        (`invalid_key`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            invalid_key:
              summary: invalid_key
              value:
                type: https://docs.osaconnection.com/errors#invalid_key
                title: Invalid API key
                status: 401
                detail: The API key is missing, malformed, revoked or expired.
                code: invalid_key
                request_id: 7f3e9a1c2b4d6e8f0a1b3c5d7e9f1a2b
    Forbidden:
      description: >
        The key is valid but can't do this. `not_in_plan`: the operation is not
        included in your

        organisation's plan and add-ons, whatever the key's own permissions.
        `insufficient_scope`:

        your plan and add-ons include the operation, but the key doesn't have
        the permission it

        needs.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            insufficient_scope:
              summary: insufficient_scope
              value:
                type: https://docs.osaconnection.com/errors#insufficient_scope
                title: Insufficient scope
                status: 403
                detail: This key doesn't have the claims:write permission.
                code: insufficient_scope
                request_id: 0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e
            not_in_plan:
              summary: not_in_plan
              value:
                type: https://docs.osaconnection.com/errors#not_in_plan
                title: Not in plan
                status: 403
                detail: >-
                  Member invitations are not included in your organisation's
                  plan and add-ons.
                code: not_in_plan
                request_id: 1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f
    DuplicateExport:
      description: >
        The export already exists (`duplicate_export`). In the key's environment
        (test or live),

        you already have an export with this `reference`. Send a corrected roof
        as a new version

        of that export instead. `existing_export_id` and `existing_export_url`
        always point to an

        export your key can read.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            duplicate_export:
              summary: duplicate_export
              value:
                type: https://docs.osaconnection.com/errors#duplicate_export
                title: Duplicate export
                status: 409
                detail: >-
                  You already have an export with reference ORDER-1042. Send a
                  corrected roof as a new version of it.
                code: duplicate_export
                request_id: 4a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d
                existing_export_id: 3f0c8a6e-5b1d-4c0e-9a77-2f6d1e4b8c90
                existing_export_url: >-
                  https://api.osaconnection.com/v1/esx-exports/3f0c8a6e-5b1d-4c0e-9a77-2f6d1e4b8c90
    PayloadTooLarge:
      description: The body is larger than 1 MB (`payload_too_large`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            payload_too_large:
              summary: payload_too_large
              value:
                type: https://docs.osaconnection.com/errors#payload_too_large
                title: Payload too large
                status: 413
                detail: Request bodies are limited to 1 MB.
                code: payload_too_large
                request_id: 1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e
    EsxExportUnprocessable:
      description: >
        The export can't be built from this request. `validation_failed` has two
        causes. The request

        is badly shaped: `errors` points at each field, with no `check` or
        `severity`, and the roof

        checks did not run. Or the roof has at least one critical problem:
        `errors` lists every

        problem the checks found, warnings included, each with its `check` and
        `severity`. A

        critical problem can stop the later checks on its structure, so check
        again after

        correcting it. `idempotency_key_reused`: the `Idempotency-Key` was
        already used with a

        different request.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            validation_failed:
              summary: validation_failed (a critical problem, with a warning beside it)
              value:
                type: https://docs.osaconnection.com/errors#validation_failed
                title: Validation failed
                status: 422
                detail: >-
                  The roof can't be built. It has 1 critical problem and 1
                  warning.
                code: validation_failed
                request_id: 7d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a
                errors:
                  - pointer: /input/structures/0/edges/2
                    check: 2
                    severity: error
                    detail: edge `ridge` joins point `g`, which does not exist
                  - pointer: /input/structures/0/edges/7
                    check: 3
                    severity: minor
                    detail: >-
                      Edge `stray` (unclassified) lies on no face. It is left
                      out of the roof.
            validation_failed_shape:
              summary: validation_failed (the request's shape; no roof checks ran)
              value:
                type: https://docs.osaconnection.com/errors#validation_failed
                title: Validation failed
                status: 422
                detail: The request has 1 invalid field.
                code: validation_failed
                request_id: 9a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d
                errors:
                  - pointer: /input/structures/0/faces/0
                    detail: must NOT have additional properties (low_egde)
            idempotency_key_reused:
              summary: idempotency_key_reused
              value:
                type: https://docs.osaconnection.com/errors#idempotency_key_reused
                title: Idempotency key reused
                status: 422
                detail: >-
                  This Idempotency-Key was already used with a different
                  request.
                code: idempotency_key_reused
                request_id: 8e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b
    RateLimited:
      description: >
        Too many requests for this key (`rate_limited`). Wait for the number of
        seconds in

        `Retry-After`, then retry.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            rate_limited:
              summary: rate_limited
              value:
                type: https://docs.osaconnection.com/errors#rate_limited
                title: Rate limited
                status: 429
                detail: This key has exceeded 300 requests per minute.
                code: rate_limited
                request_id: 9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f
    InternalError:
      description: >
        Something failed on OSA's side (`internal_error`). Retry with
        exponential backoff; for

        `POST` requests, reuse the same `Idempotency-Key`. If it persists,
        contact OSA with the

        `request_id`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            internal_error:
              summary: internal_error
              value:
                type: https://docs.osaconnection.com/errors#internal_error
                title: Internal error
                status: 500
                detail: Something went wrong on our side. Retry later.
                code: internal_error
                request_id: 2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f
    ExportProviderUnavailable:
      description: >
        The export provider could not be reached, or failed, while OSA was
        sending it a roof or a

        corrected version, or asking it for the ESX
        (`export_provider_unavailable`). Nothing was

        created or charged; for a corrected version the export may now be
        `failed`, as its

        endpoint says. Wait for the number of seconds in `Retry-After`, then
        send the same

        request again; for a roof or a version, use the same `Idempotency-Key`.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            export_provider_unavailable:
              summary: export_provider_unavailable
              value:
                type: >-
                  https://docs.osaconnection.com/errors#export_provider_unavailable
                title: Export provider unavailable
                status: 503
                detail: >-
                  The export provider could not be reached. Nothing was charged.
                  Try again shortly.
                code: export_provider_unavailable
                request_id: 6c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: osa_live_… or osa_test_…
      description: >
        Send your API key as a bearer token: `Authorization: Bearer osa_live_…`.

        Keys are opaque; each belongs to exactly one partner. Keys starting with
        `osa_test_`

        reach only test claims and test accounts. The scopes listed on each
        operation are the

        permissions the key needs. A key's permissions are set when it is issued
        and can be

        changed by OSA on request, never beyond what your plan and add-ons
        include.

        `GET /v1/me` always shows the current set.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.