Lune Webhooks API

A way to get notified about order state changes.

Operations 6

GET /webhooks List all webhooks #
POST /webhooks Create a webhook #
GET /webhooks/{id} Get a webhook #
PUT /webhooks/{id} Update a webhook #
DELETE /webhooks/{id} Delete a webhook #
PUT /webhooks/{id}/rotate-secret Rotate a webhook secret #

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/lune:lune-webhooks-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

lune-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lune Webhooks API
  version: '1.0'
  contact:
    name: Lune Support
    email: support@lune.co
  termsOfService: https://lune.co/terms
  description: 'Operations tagged Webhooks across 2 of this provider''s published API definitions: openapi.yml, lune-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.lune.co/v1
  description: Lune's REST API
tags:
- name: Webhooks
  description: A way to get notified about order state changes.
  x-lune-component: Webhook
paths:
  /webhooks:
    get:
      tags:
      - Webhooks
      summary: List all webhooks
      operationId: listAllWebhooks
      security:
      - BearerAuth: []
      parameters:
      - name: account_id
        in: query
        required: false
        description: 'Filter by account identifiers: return webhooks which push events for the given account identifiers.

          '
        schema:
          type: array
          items:
            type: string
            example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
            description: An account's unique identifier
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    post:
      tags:
      - Webhooks
      summary: Create a webhook
      operationId: createWebhook
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookFullSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
  /webhooks/{id}:
    get:
      tags:
      - Webhooks
      summary: Get a webhook
      operationId: getWebhook
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        description: The webhooks's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    put:
      tags:
      - Webhooks
      summary: Update a webhook
      operationId: updateWebhook
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        description: The webhooks's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    delete:
      tags:
      - Webhooks
      summary: Delete a webhook
      operationId: deleteWebhook
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        description: The webhooks's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
  /webhooks/{id}/rotate-secret:
    put:
      tags:
      - Webhooks
      summary: Rotate a webhook secret
      description: 'The existing secret will be invalidated immediately and subsequent webhook payloads will be

        accompanied by HMACs using the new secret.'
      operationId: rotateWebhookSecret
      security:
      - BearerAuth: []
      parameters:
      - name: id
        in: path
        required: true
        description: The webhooks's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookFullSecret'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
components:
  schemas:
    WebhookFullSecret:
      allOf:
      - $ref: '#/components/schemas/WebhookBase'
      - type: object
        required:
        - secret
        properties:
          secret:
            description: The secret key used to generate the webhook payload HMAC.
            type: string
    Error:
      type: object
      description: Individual error information
      required:
      - error_code
      - message
      properties:
        error_code:
          type: string
          description: Immutable string representing a specific error.
          example: account_suspended
          enum:
          - api_version_invalid
          - account_suspended
          - bundle_selection_ratios_invalid
          - bundle_selection_bundle_invalid
          - order_idempotency_already_exists
          - order_quantity_invalid
          - order_value_invalid
          - bundle_id_invalid
          - id_invalid
          - distance_invalid
          - test_account_name_update_disallowed
          - validation_error
          - bundle_selection_ratios_invalid_format
          - address_not_found
          - port_not_found
          - locode_not_found
          - airport_invalid
          - webhook_limit_reached
          - time_range_invalid
          - exchange_rate_not_found
          - live_account_required
          - unauthorised
          - estimate_not_found
          - estimate_order_already_placed
          - sustainability_page_slug_not_unique
          - sustainability_page_exists
          - pagination_limit_invalid
          - unsupported_image_format
          - source_location_code_invalid
          - destination_location_code_invalid
          - emission_factor_id_invalid
          - emission_factor_unit_mismatch
          - emission_factor_gated
          - account_scope_incorrect
          - service_unavailable
          - handle_not_unique
          - estimate_idempotency_already_exists
          - airport_route_required
          - future_departure_invalid
          - transaction_document_inference_failure
          - transaction_document_creation_failure
          - invalid_selected_account_id
          - account_idempotency_already_exists
          - account_handle_idempotency_key_inconsistency
          - shipment_batch_idempotency_already_exists
          - route_not_found
          - insufficient_credits
          - client_account_mismatch
        message:
          type: string
          description: 'Human readable error message.


            This value can contain some extra information about the error in

            human-readable form. Not suitable for programmatic consumption, the format

            is not guaranteed to be stable.

            '
    UpdateWebhookRequest:
      type: object
      required:
      - url
      - enabled
      properties:
        url:
          $ref: '#/components/schemas/Url'
        enabled:
          description: 'Determines if events should be sent to the webhook or not. Defaults to `true` for newly created

            webhooks. When updating a webhook and the value is not explicitly specified the existing value

            will be used.

            '
          type: boolean
        account_ids:
          description: 'The updated webhook will exclusively push events which belong to the given account identifiers.


            If not set, the previous account identifiers filter remains unchanged.

            '
          type: array
          minItems: 1
          items:
            type: string
            example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
            description: An account's unique identifier
    Webhook:
      description: 'You can configure webhook endpoints via the API to be notified about events that occur in your accounts or client accounts.

        '
      allOf:
      - $ref: '#/components/schemas/WebhookBase'
      - type: object
        required:
        - secret
        properties:
          secret:
            description: The last 4 characters of the secret key used to generate the webhook payload HMAC.
            type: string
    WebhookBase:
      type: object
      required:
      - id
      - url
      - enabled
      - account_type
      - created_at
      properties:
        id:
          description: The webhook's unique identifier
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
        url:
          $ref: '#/components/schemas/Url'
        enabled:
          description: Determines if events should be sent to the webhook or not.
          type: boolean
        account_type:
          description: 'For events related to an account, this property refers to the accounts'' type.


            A webhook does not mix live and test events.

            '
          $ref: '#/components/schemas/AccountType'
        account_ids:
          description: 'The webhook will exclusively push events which belong to account identifiers.


            Acts as a filter: if not set, events belonging to all the organisation''s accounts are pushed.

            '
          type: array
          items:
            type: string
            example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
            description: An account's unique identifier
        created_at:
          description: The webhook's creation timestamp.
          $ref: '#/components/schemas/Timestamp'
    ErrorResponse:
      x-lune-name: Error response
      description: 'An error response containing the error details.


        The `error` property provides information about the type of error that occurred.

        Use this property for error handling.


        The `errors` array is present for backwards compatibility purposes. It always

        contains a single error element which is the same seen in the `error` property.

        '
      type: object
      required:
      - errors
      - error
      properties:
        errors:
          type: array
          description: An array containing errors
          items:
            $ref: '#/components/schemas/Error'
        error:
          $ref: '#/components/schemas/Error'
    CreateWebhookRequest:
      type: object
      required:
      - url
      properties:
        url:
          $ref: '#/components/schemas/Url'
        account_ids:
          description: 'The created webhook will exclusively push events which belong to the given account identifiers.


            Act as a filter: if not set, events belonging to all the organisation''s accounts are pushed.

            '
          type: array
          minItems: 1
          items:
            type: string
            example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
            description: An account's unique identifier
    Timestamp:
      type: string
      format: date-time
      description: An <a href="https://pretty-rfc.herokuapp.com/RFC3339">RFC 3339</a>-formatted timestamp.
      example: '1985-04-12T23:20:50.52Z'
    AccountType:
      type: string
      description: 'The account''s type.

        '
      enum:
      - live
      - test
      example: live
    Url:
      type: string
      format: https-url
      description: 'An HTTPS URL.


        The URL must match the following regular expression: `^https:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)$`

        '
      example: https://lune.co
  responses:
    BadRequest:
      description: The request is invalid. Parameters may be missing or are invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too many requests have been made in a short period of time
    Unauthorized:
      description: The API Key is missing or is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnsupportedMediaType:
      description: The payload format is in an unsupported format.
    NotFound:
      description: The specified resource was not found
    PayloadTooLarge:
      description: The request is larger than 100kB.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization Bearer API Key (see <a href="#section/Authentication">Authentication</a>)
    AccessToken:
      type: apiKey
      in: query
      name: access_token
      description: 'An API key used to access a resource that accepts it in the URL.


        Note: Lune API keys are not URL-safe, which means that they can''t be included in URLs directly.

        They need to be percent-encoded using a function like JavaScript''s [`encodeURIComponent()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) or

        Python''s [`urllib.parse.quote()`](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote).

        '
x-refined-from:
- openapi.yml
- lune-openapi.yml