OpenDirect API

OpenDirect is IAB Tech Lab's standard REST API for programmatic direct (guaranteed) media buying: organizations, accounts, products, orders, lines, creatives, assignments, change requests and messages exchanged between buyer and seller systems. The 1.5.1 Swagger 2.0 contract is published verbatim; OpenDirect 2.1 is published as prose plus an MCP tool catalog (33 tools) in the mcp-config reference implementation. There is no IAB Tech Lab-hosted instance — every seller hosts its own endpoint, which is why the contract's host is a placeholder.

Operations 51

GET /accounts
POST /accounts
GET /accounts/{accountId}
GET /accounts/{accountId}/assignments
POST /accounts/{accountId}/assignments
GET /accounts/{accountId}/assignments/{assignmentId}
PUT /accounts/{accountId}/assignments/{assignmentId}
DELETE /accounts/{accountId}/assignments/{assignmentId}
PUT /accounts/{accountId}/assignments/{assignmentId}?disable
GET /accounts/{accountId}/creatives
POST /accounts/{accountId}/creatives
GET /accounts/{accountId}/creatives/{creativeId}
PUT /accounts/{accountId}/creatives/{creativeId}
DELETE /accounts/{accountId}/creatives/{creativeId}
GET /accounts/{accountId}/orders
POST /accounts/{accountId}/orders
GET /accounts/{accountId}/orders/{orderId}
PUT /accounts/{accountId}/orders/{orderId}
DELETE /accounts/{accountId}/orders/{orderId}
GET /accounts/{accountId}/orders/{orderId}/lines
POST /accounts/{accountId}/orders/{orderId}/lines
GET /accounts/{accountId}/orders/{orderId}/lines/{lineId}
PUT /accounts/{accountId}/orders/{orderId}/lines/{lineId}
DELETE /accounts/{accountId}/orders/{orderId}/lines/{lineId}
PUT /accounts/{accountId}/orders/{orderId}/lines/{lineId}?book
PUT /accounts/{accountId}/orders/{orderId}/lines/{lineId}?reserve
PUT /accounts/{accountId}/orders/{orderId}/lines/{lineId}?cancel
PUT /accounts/{accountId}/orders/{orderId}/lines/{lineId}?reset
GET /organizations
POST /organizations
GET /organizations/{organizationId}
PUT /organizations/{organizationId}
DELETE /organizations/{organizationId}
GET /products
GET /products/{productId}
POST /products/search
POST /products/avails
GET /accounts/{accountId}/changerequest
POST /accounts/{accountId}/changerequest
GET /accounts/{accountId}/changerequest/{changerequestId}
PUT /accounts/{accountId}/changerequest/{changerequestId}
DELETE /accounts/{accountId}/changerequest/{changerequestId}
PUT /accounts/{accountId}/changerequest/{changerequestId}?approve
PUT /accounts/{accountId}/changerequest/{changerequestId}?reject
GET /accounts/{accountId}/changerequest/{changerequestId}/lines
POST /accounts/{accountId}/changerequest/{changerequestId}/lines
GET /accounts/{accountId}/changerequest/{changerequestId}/lines/{lineId}
PUT /accounts/{accountId}/changerequest/{changerequestId}/lines/{lineId}
DELETE /accounts/{accountId}/changerequest/{changerequestId}/lines/{lineId}
GET /accounts/{accountId}/orders/{orderId}/lines/stats
GET /accounts/{accountId}/orders/{orderId}/lines/{lineId}/stats

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/opendirect-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

iab-tech-lab-opendirect-1-5-1-swagger.yaml Raw ↑
swagger: "2.0"

info:
  version: 1.5.1
  title: OpenDirect
  description: OpenDirect enables publishers to offer premium inventory using a programmatic interface that partners and vendors build according to the OpenDirect specifications.

schemes:
   - https
host: opendirect.example.com
basePath: /v1.5.1

consumes:
  - application/json
produces:
  - application/json

securityDefinitions:
  OauthSecurity:
    type: oauth2
    description: Example of one of OAuth 2.0 authorization flow that can be used according to specification.
    flow: implicit
    authorizationUrl: https://opendirect.example.com/connect/authorize
    scopes:
      https://opendirect.example.com/scope/example: Example scope

security:
  - OauthSecurity:
    - https://opendirect.example.com/scope/example

paths:
  # Accounts
  /accounts:
    get:
      tags: ["Accounts"]
      description: |
        Gets a list of all accounts.
        For an advertiser, the list of accounts will include only accounts that they own. However, for an agency, the list of accounts will include the accounts that they own and the accounts that they manage on behalf of advertisers.
        User should be able to filter the accounts by any of the fields or field values of the owned account. Logical AND/OR condition of the fields shall be allowed.
      parameters:
       - $ref: "#/parameters/count"
       - $ref: "#/parameters/offset"
       - name: $filter
         in: query
         description: |
          Allows to get a list of accounts that match the specified filter criteria. The user may use OData expressions with the following Account properties:
          - AdvertiserId
          - BuyerId
          May also support getting a list of IDs.
         type: string
      responses:
        200:
          $ref: "#/responses/AccountsResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Accounts"]
      description: |
        Adds an account.
        An advertiser or agency may add accounts to only the organization they own; an agency may not add accounts to an advertiser’s organization. If an advertiser wants an agency to manage an account on their behalf, the advertiser must add the account and set the account’s BuyerId to the agency’s organization ID.
        An organization may add as many accounts as needed to create a buying structure that supports their needs. For example, the organization may create a single account, an account for each region, an account for each brand, and so on.
      parameters:
        - name: Account
          in: body
          required: true
          schema:
            $ref: "#/definitions/Account"
      responses:
        201:
          $ref: "#/responses/AccountResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}:
    get:
      tags: ["Accounts"]
      description: |
        Gets the specified account.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get the accounts that they own. In addition, an agency may get the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
      responses:
        200:
          $ref: "#/responses/AccountResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"

  # Assignments
  /accounts/{accountId}/assignments:
    get:
      tags: ["Assignments"]
      description: |
        Gets a list of all assignments that belong to the account.
        For advertisers, the list will include only assignments that they own. For agencies, the list will include the assignments that they own and the assignments that belong to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/count"
        - $ref: "#/parameters/offset"
        - name: $filter
          in: query
          description: |
            Allows to get a list of assignments that match the specified filter criteria. The caller may use OData expressions with the following Assignment properties:
            - CreativeId
            - LineId
            - StartDate
            - EndDate
            The user must have permissions to access the assignment. For example, advertisers and agencies may get assignments that they own. In addition, an agency may get assignments that belong to the accounts that they manage on behalf of advertisers.
          type: string
      responses:
        200:
          $ref: "#/responses/AssignmentsResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Assignments"]
      description: |
        Adds an assignment to the specified account. To add an assignment, the creative must be approved. An assignment may be added at any time prior to the order finishing its flight.
        An advertiser or agency may add assignments to accounts that they own. In addition; an agency may add assignments to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - name: Assignment
          in: body
          required: true
          schema:
            $ref: "#/definitions/Assignment"
      responses:
        201:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/assignments/{assignmentId}:
    get:
      tags: ["Assignments"]
      description: |
        Gets the specified assignment.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get the assignments that they own. In addition, an agency may get assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/assignmentId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    put:
      tags: ["Assignments"]
      description: |
        Updates the specified assignment.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may update the assignments that they own. In addition, an agency may update assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/assignmentId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    delete:
      tags: ["Assignments"]
      description: |
        Deletes the specified assignment. May delete an assignment only if it has never delivered impressions.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may delete the assignments that they own. In addition, an agency may delete assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/assignmentId"
      responses:
        204:
          description: Assignment successfully deleted.
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/assignments/{assignmentId}?disable:
    put:
      tags: ["Assignments"]
      description: |
        Changes the status to “Inactive”.
        The user must have permissions to access the assignment. For example, advertisers and agencies may disable Assignments that they own. In addition, an agency may disable assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/assignmentId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"

  # Creatives
  /accounts/{accountId}/creatives:
    get:
      tags: ["Creatives"]
      description: |
        Gets a list of all creatives that belong to the account.
        For advertisers, the list will include only creatives that they own. For agencies, the list will include the creatives that they own and the creatives that belong to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/count"
        - $ref: "#/parameters/offset"
        - name: $filter
          in: query
          description: |
            Allows to get a list of creatives that match the specified filter criteria. The user may use OData expressions with the following Creative properties:
            - AdStatus
            May support getting a list by IDs.
          type: string
      responses:
        200:
          $ref: "#/responses/CreativesResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Creatives"]
      description: |
        Adds an assignment to the specified account. To add an assignment, the creative must be approved. An assignment may be added at any time prior to the order finishing its flight.
        An advertiser or agency may add assignments to accounts that they own. In addition; an agency may add assignments to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - name: Creative
          in: body
          required: true
          schema:
            $ref: "#/definitions/Creative"
      responses:
        201:
          $ref: "#/responses/CreativeResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/creatives/{creativeId}:
    get:
      tags: ["Creatives"]
      description: |
        Gets the specified assignment.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get the assignments that they own. In addition, an agency may get assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/creativeId"
      responses:
        200:
          $ref: "#/responses/CreativeResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    put:
      tags: ["Creatives"]
      description: |
        Updates the specified assignment.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may update the assignments that they own. In addition, an agency may update assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/creativeId"
      responses:
        200:
          $ref: "#/responses/CreativeResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    delete:
      tags: ["Creatives"]
      description: |
        Deletes the specified assignment. May delete an assignment only if it has never delivered impressions.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may delete the assignments that they own. In addition, an agency may delete assignments that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/creativeId"
      responses:
        204:
          description: Creative successfully deleted.
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"

  # Orders
  /accounts/{accountId}/orders:
    get:
      tags: ["Orders"]
      description: |
        Gets a list of all orders that belong to the account.
        For advertisers, the list will include only orders that they own. For agencies, the list will include the orders that they own and the orders that belong to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/count"
        - $ref: "#/parameters/offset"
        - name: $filter
          in: query
          description: |
            Allows to get a list of creatives that match the specified filter criteria. The user may use OData expressions with the following Creative properties:
            - AdStatus
            May support getting a list by IDs.
            User should be either an advertiser or buyer who owns the orders.
          type: string
      responses:
        200:
          $ref: "#/responses/OrdersResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Orders"]
      description: |
        Adds an order to the account.
        An advertiser or agency may add orders to accounts that they own. In addition; an agency may add orders to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - name: Order
          in: body
          required: true
          schema:
            $ref: "#/definitions/Order"
      responses:
        201:
          $ref: "#/responses/OrderResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}:
    get:
      tags: ["Orders"]
      description: |
        Gets the specified order.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get the orders that they own. In addition, an agency may get the orders that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
      responses:
        200:
          $ref: "#/responses/OrderResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    put:
      tags: ["Orders"]
      description: |
        Updates the specified order.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may update the orders that they own. In addition, an agency may update the orders that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
      responses:
        200:
          $ref: "#/responses/OrderResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    delete:
      tags: ["Orders"]
      description: |
        Deletes the specified order. May delete the order only if all lines in the order are in the Draft state. Must also delete assignments that reference the line.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may delete the orders that they own. In addition, an agency may delete the orders that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
      responses:
        204:
          description: Order successfully deleted.
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"

  # Lines
  /accounts/{accountId}/orders/{orderId}/lines:
    get:
      tags: ["Lines"]
      description: |
        Gets a list of all lines in the order.
        For advertisers, the list will include only lines that they own. For agencies, the list will include the lines that they own and the lines that belong to accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/count"
        - $ref: "#/parameters/offset"
        - name: $filter
          in: query
          description: |
            Allows to get a list of lines that match the specified filter criteria. The user may use OData expressions and method calls with the following Line properties:
            - Name
            - BookingStatus
            - StartDate
            - EndDate
            May also support getting a list by IDs.
          type: string
      responses:
        200:
          $ref: "#/responses/LinesResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Lines"]
      description: |
        Adds a line to the order.
        An advertiser or agency may add lines to orders that they own. In addition; an agency may add lines to orders that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - name: Line
          in: body
          required: true
          schema:
            $ref: "#/definitions/Line"
      responses:
        201:
          $ref: "#/responses/LineResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}/lines/{lineId}:
    get:
      tags: ["Lines"]
      description: |
        Gets the specified line from the order.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get the Lines that they own. In addition, an agency may get the lines that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/LineResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    put:
      tags: ["Lines"]
      description: |
        Updates the specified line. To update a line, the line must be in the Draft state.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may update the Lines that they own. In addition, an agency may update the lines that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/LineResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    delete:
      tags: ["Lines"]
      description: |
        Deletes the specified line. May delete a line only if it’s in the Draft state. Must also delete assignments that reference the line.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may delete the Lines that they own. In addition, an agency may delete the lines that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        204:
          description: Line successfully deleted.
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}/lines/{lineId}?book:
    put:
      tags: ["Lines"]
      description: |
        Begins the booking process for the line. The booking process may be asynchronous.
        To book a line, the line must:
        - Be in the Draft or Reserved state.
        - Have a creative assigned (if AllowNoCreative is false in Product).
        - Have available impressions.
        If successfully booked, the line moves to the Booked state; otherwise, it moves to Declined and sets StateChangedReason.
        The user must have permissions to book the line. For example, advertisers and agencies may book Lines that they own. In addition, an agency may book lines that belong to the accounts that they manage on behalf of advertisers. Only organizations that have an Approved or Limited status may book lines.
        The booking process may be asynchronous. If asynchronous, set the BookingStatus field to PendingBooking until the line is booked or declined. If successfully booked, set the BookingStatus field to Booked; otherwise, set the BookingStatus field to Declined and specify why the request was declined in the StateChangedReason field.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}/lines/{lineId}?reserve:
    put:
      tags: ["Lines"]
      description: |
        Reserves the line. The reserve process may be asynchronous. To reserve a line, the line must be in the Draft state. If successfully reserved, the line moves to the Reserved state; otherwise, it moves to Declined and StateChangedReason is set.
        The user must have permissions to reserve the line. For example, advertisers and agencies may reserve Lines that they own. In addition, an agency may reserve lines that belong to the accounts that they manage on behalf of advertisers.
        Only organizations that have an Approved or Limited status may reserve lines.
        The reservation process may be asynchronous. If asynchronous, set the BookingStatus field to PendingReservation until the line is reserved or declined. If successfully reserved, set the BookingStatus field to Reserved and the ReservedExpiryDate field to the date and time that the reservation expires. If the line was not reserved, set the BookingStatus field to Declined and specify why the request was declined in the StateChangedReason field.
        Supporting reserve is optional.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}/lines/{lineId}?cancel:
    put:
      tags: ["Lines"]
      description: |
        Cancels the line. To cancel a line, the line must be in the Reserved, Booked, or InFlight state. If successfully canceled, the line moves to the Canceled state. If the status was InFlight, StateChangedReason is set.
        The user must have permissions to cancel the line. For example, advertisers and agencies may cancel Lines that they own. In addition, an agency may cancel lines that belong to the accounts that they manage on behalf of advertisers.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /accounts/{accountId}/orders/{orderId}/lines/{lineId}?reset:
    put:
      tags: ["Lines"]
      description: |
        Resets a line back to the Draft state.
        The user must have permissions to reset the line. For example, advertisers and agencies may reset Lines that they own. In addition, an agency may reset lines that belong to the accounts that they manage on behalf of advertisers. To reset a line, the line must be in the Reserved, Declined, or Expired booking state. If successfully reset, set the BookingStatus field to Draft.
      parameters:
        - $ref: "#/parameters/accountId"
        - $ref: "#/parameters/orderId"
        - $ref: "#/parameters/lineId"
      responses:
        200:
          $ref: "#/responses/AssignmentResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"

  # Organizations
  /organizations:
    get:
      tags: ["Organizations"]
      description: |
        Gets a list of all organizations that the user has access to. The list may contain both advertiser and agency organizations depending on the caller’s access. For example, if the caller is an advertiser, the list might contain only the advertiser’s organization objects; however, if the caller is an agency, the list will contain the agency’s organization objects and the organization objects of the advertisers whose accounts that they manage.
        The list will contain a single organization for advertisers; however, for agencies, the list will include the agency’s organization and the organizations of the advertisers whose accounts they manage.
      parameters:
       - $ref: "#/parameters/count"
       - $ref: "#/parameters/offset"
       - name: $filter
         in: query
         description: |
           Allows to get a list of organizations that match the specified filter criteria. The user may use OData expressions and method calls with the following Organization properties:
           - Name
           - Status
           - One or more organization IDs
         type: string
      responses:
        200:
          $ref: "#/responses/OrganizationsResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    post:
      tags: ["Organizations"]
      description: Adds an organization. Note that POST is not supported in the public API; it is included here for completeness. The process of adding advertiser and agency organizations and providing credentials is publisher defined. Once the publisher creates an organization for an agency, the agency may create organizations for its clients. Advertisers that represent themselves may also create organizations for other verticals within the advertiser's company if publisher-approved. However, all Organizations on an Account must be in an "Approved" or "Limited" state before inventory can be searched and booked.
      parameters:
        - name: Product
          in: body
          required: true
          schema:
            $ref: "#/definitions/Product"
      responses:
        201:
          $ref: "#/responses/ProductResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
  /organizations/{organizationId}:
    get:
      tags: ["Organizations"]
      description: |
        Gets the specified organization.
        The user must have permissions to perform the requested action. For example, advertisers and agencies may get  the Organization that they own; however, an agency may only get the organization of the advertisers whose accounts they manage.
      parameters:
        - $ref: "#/parameters/organizationId"
      responses:
        200:
          $ref: "#/responses/OrganizationResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    put:
      tags: ["Organizations"]
      description: |
        Updates the specified organization.
        The caller must have permissions to update the organization. For example, an advertiser and agency may update their organization object but an agency may not update an advertiser’s Organization object.
      parameters:
        - $ref: "#/parameters/organizationId"
      responses:
        200:
          $ref: "#/responses/OrganizationResponse"
        400:
          $ref: "#/responses/Standard400ErrorResponse"
        401:
          $ref: "#/responses/Standard401ErrorResponse"
        404:
          $ref: "#/responses/Standard404ErrorResponse"
        500:
          $ref: "#/responses/Standard500ErrorResponse"
    delete:
      tags: ["Organizations"]
      description: The process of deleting an organization is publisher defined; however, deleting an organization via the API is not supported.
      parameters:
        - $ref: "#/parameters/organizationId"

# --- truncated at 32 KB (113 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/iab-tech-lab/refs/heads/main/openapi/iab-tech-lab-opendirect-1-5-1-swagger.yaml