{
  "openapi": "3.1.0",
  "info": {
    "title": "Trackified API",
    "version": "1.0.0",
    "description": "Track parcels across carriers: add tracking numbers, read their event history and receive signed webhooks when they change."
  },
  "servers": [
    {
      "url": "https://api.trackified.net"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/trackings": {
      "post": {
        "summary": "Add a tracking",
        "description": "Send an Idempotency-Key header to make retries safe: for 24 hours, the same key with the same body returns the tracking it created (with `Idempotent-Replayed: true`) instead of adding another. The same key with a different body is `422 idempotency_key_reused`; a retry while the first request is still running is `409 idempotency_in_progress`. Without a key, look a tracking up with `GET /v1/trackings?custom_id=…` before retrying.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "1 to 255 printable characters, unique per create. A UUID or your own order id works.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackingInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, or the tracking an earlier request with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tracking"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      },
      "get": {
        "summary": "List trackings",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/TrackingStatus"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_id",
            "in": "query",
            "description": "Your own reference, exactly as sent on create.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tracking_number",
            "in": "query",
            "description": "Exact match.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trackings, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tracking"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      }
    },
    "/v1/trackings/bulk": {
      "post": {
        "summary": "Add a batch of trackings",
        "description": "The maximum batch size depends on your plan. Each row succeeds or fails on its own.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "trackings"
                ],
                "properties": {
                  "trackings": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrackingInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "207": {
            "description": "One result per row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      }
    },
    "/v1/trackings/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Get a tracking with its events",
        "responses": {
          "200": {
            "description": "The tracking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tracking"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      },
      "put": {
        "summary": "Update a tracking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "carrier": {
                    "type": "string"
                  },
                  "custom_id": {
                    "type": "string"
                  },
                  "customer_email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated tracking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tracking"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      },
      "delete": {
        "summary": "Stop tracking a parcel",
        "responses": {
          "200": {
            "description": "Stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      }
    },
    "/v1/trackings/{id}/retrack": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "summary": "Check the carrier again within a minute",
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "queued": {
                      "type": "boolean"
                    },
                    "tracking": {
                      "$ref": "#/components/schemas/Tracking"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Trackings"
        ]
      }
    },
    "/v1/carriers": {
      "get": {
        "summary": "List the carriers we track",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Carriers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Carrier"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Carriers"
        ]
      }
    },
    "/v1/carriers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Get a carrier",
        "responses": {
          "200": {
            "description": "The carrier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Carrier"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Carriers"
        ]
      }
    },
    "/v1/carriers/detect": {
      "get": {
        "summary": "Detect the carrier for a tracking number",
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candidates, most likely first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tracking_number": {
                      "type": "string"
                    },
                    "candidates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CarrierCandidate"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Carriers"
        ]
      }
    },
    "/v1/carriers/catalog": {
      "get": {
        "security": [],
        "summary": "Search carriers by name",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "support",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "scraper",
                "api",
                "unsupported"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching carriers, ones we track first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Carriers"
        ]
      }
    },
    "/v1/carriers/status": {
      "get": {
        "summary": "How each carrier has been validated",
        "responses": {
          "200": {
            "description": "Counts and per-carrier results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Carriers"
        ]
      }
    },
    "/v1/webhooks": {
      "post": {
        "summary": "Add a webhook endpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WebhookEventType"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. The full signing secret is returned only here.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "secret": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "summary": "List webhook endpoints",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "summary": "Remove a webhook endpoint",
        "responses": {
          "200": {
            "description": "Removed"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "summary": "Sign a sample event without sending it",
        "responses": {
          "200": {
            "description": "The signed sample",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signature": {
                      "type": "string"
                    },
                    "body": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook-deliveries": {
      "get": {
        "summary": "List recent webhook delivery attempts",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/account/api-keys": {
      "post": {
        "summary": "Create an API key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "test",
                      "live"
                    ]
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. The token is returned only here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      },
      "get": {
        "summary": "List API keys",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/api-keys/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "summary": "Revoke an API key",
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/account/usage": {
      "get": {
        "summary": "This month's usage and limits",
        "description": "Poll this to see quota before a create fails with `402 quota_exceeded`. The period is the calendar month in UTC.",
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Account"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "TrackingStatus": {
        "type": "string",
        "enum": [
          "not_yet_scanned",
          "in_transit",
          "out_for_delivery",
          "available_for_pickup",
          "delivered",
          "exception",
          "returned",
          "unknown"
        ]
      },
      "TrackingInput": {
        "type": "object",
        "required": [
          "tracking_number"
        ],
        "properties": {
          "tracking_number": {
            "type": "string"
          },
          "carrier": {
            "type": "string",
            "description": "Leave out to detect it from the number. If no carrier can be detected confidently, the request fails with 422 carrier_not_detected; pass the carrier explicitly."
          },
          "custom_id": {
            "type": "string",
            "description": "Your own reference, such as an order number."
          },
          "customer_email": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "EventStatus": {
        "type": "string",
        "enum": [
          "info_received",
          "in_transit",
          "out_for_delivery",
          "available_for_pickup",
          "delivered",
          "exception",
          "returned",
          "unknown"
        ],
        "description": "info_received: the carrier has the shipment's details (label created) but not the parcel. in_transit: picked up and moving, including leaving the shipper. out_for_delivery: on the final delivery run. available_for_pickup: waiting at a collection point for the recipient. A tracking with only info_received events is not_yet_scanned."
      },
      "TrackingEvent": {
        "type": "object",
        "description": "Newest first.",
        "required": [
          "occurred_at",
          "time_zone_known",
          "status",
          "description",
          "location",
          "date"
        ],
        "properties": {
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601. With an offset (2026-06-25T14:31:28Z) when the carrier gave a time zone; otherwise the local time where the scan happened, with no offset (2026-06-25T14:22:00), or a date alone (2026-06-25). null when the carrier's time couldn't be read; the original is in date."
          },
          "time_zone_known": {
            "type": "boolean",
            "description": "true when occurred_at carries an offset."
          },
          "status": {
            "$ref": "#/components/schemas/EventStatus"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "The time exactly as the carrier printed it. Use occurred_at."
          }
        }
      },
      "Tracking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tracking_number": {
            "type": "string"
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "carrier_detected": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/TrackingStatus"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackingEvent"
            }
          },
          "estimated_delivery": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was delivered: the delivered scan's time, in the same form as an event's occurred_at. Only falls back to delivery_detected_at when the scan's time can't be read."
          },
          "delivered_at_time_zone_known": {
            "type": "boolean"
          },
          "delivery_detected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When Trackified first saw it delivered."
          },
          "exception": {
            "type": [
              "string",
              "null"
            ]
          },
          "service_level": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_scraped_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_scrape_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BulkResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ok": {
                  "type": "boolean"
                },
                "tracking": {
                  "$ref": "#/components/schemas/Tracking"
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Carrier": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          }
        }
      },
      "CarrierCandidate": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "tracking.created",
          "tracking.updated",
          "tracking.status_changed",
          "tracking.delivered",
          "tracking.exception",
          "tracking.returned",
          "tracking.expired"
        ]
      },
      "Usage": {
        "type": "object",
        "required": [
          "period_start",
          "period_end",
          "plan",
          "trackings_used",
          "trackings_limit",
          "trackings_remaining",
          "rate_limit_per_minute",
          "webhook_deliveries",
          "carrier_volume"
        ],
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the billing month (UTC)."
          },
          "period_end": {
            "type": "string",
            "format": "date-time",
            "description": "When the count resets (UTC)."
          },
          "plan": {
            "type": "string",
            "description": "free, starter, pro or scale."
          },
          "trackings_used": {
            "type": "integer",
            "description": "Trackings added this period."
          },
          "trackings_limit": {
            "type": "integer"
          },
          "trackings_remaining": {
            "type": "integer",
            "description": "trackings_limit minus trackings_used, never below 0."
          },
          "rate_limit_per_minute": {
            "type": "integer"
          },
          "webhook_deliveries": {
            "type": "integer",
            "description": "Webhook delivery attempts this period."
          },
          "carrier_volume": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "carrier",
                "count"
              ],
              "properties": {
                "carrier": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "event_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "secret_preview": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "test",
              "live"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "token": {
            "type": "string",
            "description": "Only present in the create response."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Trackings",
      "description": "Add tracking numbers and read their event history."
    },
    {
      "name": "Carriers",
      "description": "The carriers we track, and carrier detection."
    },
    {
      "name": "Webhooks",
      "description": "Signed events when a tracking changes."
    },
    {
      "name": "Account",
      "description": "API keys and usage."
    }
  ]
}