Wove TMS Organizations API

TMS organization management - CRUD and bulk JSONL import

OpenAPI Specification

wove-tms-organizations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Wove External Authentication TMS Organizations API
  version: 1.0.0
  description: "# Wove External API Documentation\n\nThe Wove External API allows you to programmatically access document processing, shipment management, and validation capabilities.\n\n## Features\n\n- **OAuth 2.0 Authentication**: Secure client credentials flow\n- **Rate Limiting**: Configurable per-client rate limits\n- **Document Processing**: Upload, validate, and merge shipping documents\n- **Shipment Management**: Create and manage shipment records with validation and merge operations\n- **Webhooks**: Get notified of document processing events (extraction, validation, merge)\n- **Comprehensive Error Handling**: Detailed error responses with troubleshooting information\n\n## Getting Started\n\n1. **Create OAuth Client**: Contact your account manager to create OAuth credentials\n2. **Get Access Token**: Use client credentials flow to obtain bearer token\n3. **Make API Calls**: Include bearer token in Authorization header\n4. **Handle Rate Limits**: Monitor rate limit headers in responses\n\n## Authentication\n\nAll API endpoints require OAuth 2.0 authentication using the client credentials flow.\n\n### Getting an Access Token\n\n```bash\ncurl -X POST https://api.wove.com/api/v1/external/auth/token \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"grant_type\": \"client_credentials\",\n    \"client_id\": \"your_client_id\",\n    \"client_secret\": \"your_client_secret\"\n  }'\n```\n\n### Using the Access Token\n\nInclude the access token in the Authorization header:\n\n```bash\ncurl -H \"Authorization: Bearer your_access_token\" \\\n  https://api.wove.com/api/v1/external/shipments\n```\n\n## Rate Limiting\n\nAll endpoints are subject to rate limiting based on your OAuth client configuration:\n\n- **Per-minute limit**: Default 60 requests/minute\n- **Daily limit**: Default 10,000 requests/day\n\nRate limit information is included in response headers:\n- `X-RateLimit-Limit-Minute`: Your per-minute limit\n- `X-RateLimit-Remaining-Minute`: Remaining requests this minute\n- `X-RateLimit-Reset-Minute`: When the minute window resets\n- `X-RateLimit-Limit-Day`: Your daily limit\n- `X-RateLimit-Remaining-Day`: Remaining requests today\n- `X-RateLimit-Reset-Day`: When the daily window resets\n\n## Webhook Security\n\nAll webhook payloads are signed using HMAC-SHA256 for verification:\n\n```javascript\n// Verify webhook signature\nconst crypto = require('crypto');\nconst signature = request.headers['x-wove-signature'];\nconst payload = JSON.stringify(request.body);\nconst expectedSignature = crypto\n  .createHmac('sha256', your_webhook_secret)\n  .update(payload)\n  .digest('hex');\n\nconst isValid = crypto.timingSafeEqual(\n  Buffer.from(signature),\n  Buffer.from(expectedSignature)\n);\n```\n\nHeaders included with every webhook:\n- `X-Wove-Signature`: HMAC-SHA256 signature of the payload\n- `X-Wove-Event`: Event type (e.g., \"extraction.completed\")\n- `X-Wove-Timestamp`: ISO timestamp when the webhook was sent\n\n## Error Handling\n\nAll errors follow a consistent format:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"VALIDATION_ERROR\",\n    \"message\": \"One or more documents not found or access denied\",\n    \"details\": {\n      \"field\": \"documentIds\",\n      \"value\": [\"invalid_id\"]\n    }\n  }\n}\n```\n\n### Error Codes\n\n- `VALIDATION_ERROR` - Invalid request parameters or data validation failure\n- `AUTHENTICATION_ERROR` - Invalid or expired credentials\n- `AUTHORIZATION_ERROR` - Insufficient permissions for the requested operation\n- `NOT_FOUND` - Requested resource not found\n- `RATE_LIMIT_ERROR` - Too many requests, rate limit exceeded\n- `INTERNAL_ERROR` - Internal server error\n\nSee the common error responses in the components section for detailed examples.\n"
  contact:
    name: Wove API Support
    email: api-support@wove.com
    url: https://docs.wove.com
  license:
    name: Proprietary
    url: https://wove.com/terms
servers:
- url: https://api.wove.com
  description: Production server
- url: https://staging-api.wove.com
  description: Staging server
- url: http://localhost:4000
  description: Development server
security:
- bearerAuth: []
tags:
- name: TMS Organizations
  description: TMS organization management - CRUD and bulk JSONL import
paths:
  /api/v1/external/tms/organizations:
    get:
      tags:
      - TMS Organizations
      summary: List TMS organizations
      description: Retrieve a paginated list of TMS organizations for your customer.
      security:
      - bearerAuth: []
      parameters:
      - name: page
        in: query
        schema:
          type: integer
          minimum: 1
          default: 1
        description: Page number
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 50
        description: Items per page
      - name: source
        in: query
        schema:
          type: string
          enum:
          - cw
          - gf
          - lw
          - ns
        description: Filter by TMS source
      - name: type
        in: query
        schema:
          type: string
        description: Filter by organization type (e.g. consignee, shipper, carrier)
      - name: active
        in: query
        schema:
          type: boolean
        description: Filter by active status
      - name: search
        in: query
        schema:
          type: string
        description: Search by name, code, city, state, country, or email
      responses:
        '200':
          description: Organizations retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TmsOrganization'
                  pagination:
                    $ref: '#/components/schemas/PaginatedResponse/properties/pagination'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
      - TMS Organizations
      summary: Create a TMS organization
      description: Create a new TMS organization. The combination of (source, code) must be unique.
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTmsOrganizationRequest'
      responses:
        '201':
          description: Organization created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TmsOrganization'
        '400':
          description: Invalid request or duplicate organization code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:write scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/v1/external/tms/organizations/{organizationId}:
    get:
      tags:
      - TMS Organizations
      summary: Get a TMS organization
      description: Retrieve a specific TMS organization by ID.
      security:
      - bearerAuth: []
      parameters:
      - name: organizationId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Organization retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TmsOrganization'
        '404':
          $ref: '#/components/schemas/NotFoundError'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      tags:
      - TMS Organizations
      summary: Update a TMS organization
      description: Update an existing TMS organization. Only provided fields are updated.
      security:
      - bearerAuth: []
      parameters:
      - name: organizationId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTmsOrganizationRequest'
      responses:
        '200':
          description: Organization updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TmsOrganization'
        '400':
          description: Invalid request or duplicate organization code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          $ref: '#/components/schemas/NotFoundError'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:write scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      tags:
      - TMS Organizations
      summary: Delete a TMS organization
      description: Delete a TMS organization by ID.
      security:
      - bearerAuth: []
      parameters:
      - name: organizationId
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Organization deleted successfully
        '404':
          $ref: '#/components/schemas/NotFoundError'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:delete scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/v1/external/tms/organizations/import:
    post:
      tags:
      - TMS Organizations
      summary: Import organizations from JSONL file
      description: 'Upload a JSONL file to bulk import TMS organizations. Each line must be a JSON object

        with at least `code` and `name` fields. Processing is asynchronous — returns a job ID

        that can be polled for status. A `bulk_upload.completed` or `bulk_upload.failed` webhook

        is fired when the job finishes, including row-level stats (totalRows, successfulRows, failedRows).

        '
      security:
      - bearerAuth: []
      parameters:
      - name: source
        in: query
        required: true
        schema:
          type: string
          enum:
          - cw
          - gf
          - lw
          - ns
        description: TMS source for the imported organizations
      - name: mode
        in: query
        schema:
          type: string
          enum:
          - replace
          - merge
          - skip
          default: merge
        description: 'Import mode: `merge` (upsert), `skip` (skip existing), `replace` (delete all then insert)

          '
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: JSONL file (max 10MB)
              required:
              - file
      responses:
        '200':
          description: Import job queued successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TmsOrganizationImportResponse'
        '400':
          description: Invalid source, mode, or file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:write scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/v1/external/tms/organizations/import/{jobId}:
    get:
      tags:
      - TMS Organizations
      summary: Get import job status
      description: Check the status and progress of an organization import job.
      security:
      - bearerAuth: []
      parameters:
      - name: jobId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Import job status retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TmsOrganizationImportStatus'
        '404':
          $ref: '#/components/schemas/NotFoundError'
        '401':
          $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Insufficient permissions - requires tms-organizations:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaginatedResponse:
      properties:
        pagination:
          type: object
          properties:
            page:
              type: integer
              example: 1
            limit:
              type: integer
              example: 20
            total:
              type: integer
              example: 150
            totalPages:
              type: integer
              example: 8
            hasNext:
              type: boolean
              example: true
            hasPrev:
              type: boolean
              example: false
          required:
          - page
          - limit
          - total
          - totalPages
          - hasNext
          - hasPrev
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Invalid input parameters
            details:
              type: object
              description: Additional error context
      required:
      - success
      - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 Bearer token obtained from /auth/token endpoint