MVMNT Companies API

Company management operations

OpenAPI Specification

mvmnt-companies-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: MVMNT Bill Payments Companies API
  version: 1.0.0
  description: "The MVMNT API enables you to automate freight brokerage workflows by integrating\ndirectly with our Transportation Management System.\n\n## Authentication\n\nOAuth 2.0 client credentials flow. See [Authentication Guide](/getting-started/authentication)\nfor details.\n\n### Token Endpoint\n\n```\nPOST https://api.mvmnt.io/oauth2/token\n```\n\n#### Request\n\n**Headers:**\n```http\nContent-Type: application/x-www-form-urlencoded\n```\n\n**Body Parameters:**\n```\ngrant_type=client_credentials\nclient_id=YOUR_CLIENT_ID\nclient_secret=YOUR_CLIENT_SECRET\n```\n\n#### Example Request\n\n```bash\ncurl -X POST https://api.mvmnt.io/oauth2/token \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -d \"grant_type=client_credentials\" \\\n  -d \"client_id=YOUR_CLIENT_ID\" \\\n  -d \"client_secret=YOUR_CLIENT_SECRET\"\n```\n\n#### Success Response\n\n**Status:** `200 OK`\n\n```json\n{\n  \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 3600\n}\n```\n\n**Response Fields:**\n- `access_token`: JWT Bearer token to use for API requests\n- `token_type`: Always `Bearer`\n- `expires_in`: Token lifetime in seconds (3600 = 1 hour)\n"
  contact:
    name: MVMNT Support
    email: support@mvmnt.io
    url: https://docs.mvmnt.io
  license:
    name: Proprietary
    url: https://mvmnt.io/legal/terms
  x-parsed-md-description:
    result:
    - $$mdtype: Node
      errors: []
      lines:
      - 0
      - 2
      inline: false
      attributes: {}
      children:
      - $$mdtype: Node
        errors: []
        lines:
        - 0
        - 2
        inline: false
        attributes: {}
        children:
        - $$mdtype: Node
          errors: []
          lines:
          - 0
          - 2
          inline: true
          attributes:
            content: The MVMNT API enables you to automate freight brokerage workflows by integrating
          children: []
          type: text
          annotations: []
          slots: {}
        - $$mdtype: Node
          errors: []
          lines:
          - 0
          - 2
          inline: true
          attributes: {}
          children: []
          type: softbreak
          annotations: []
          slots: {}
        - $$mdtype: Node
          errors: []
          lines:
          - 0
          - 2
          inline: true
          attributes:
            content: directly with our Transportation Management System.
          children: []
          type: text
          annotations: []
          slots: {}
        type: inline
        annotations: []
        slots: {}
      type: paragraph
      annotations: []
      slots: {}
    - $$mdtype: Node
      errors: []
      lines:
      - 3
      - 4
      inline: false
      attributes:
        level: 2
      children:
      - $$mdtype: Node
        errors: []
        lines:
        - 3
        - 4
        inline: false
        attributes: {}
        children:
        - $$mdtype: Node
          errors: []
          lines:
          - 3
          - 4
          inline: true
          attributes:
            content: Authentication
          children: []
          type: text
          annotations: []
          slots: {}
        type: inline
        annotations: []
        slots: {}
      type: heading
      annotations: []
      slots: {}
    - $$mdtype: Node
      errors: []
      lines:
      - 5
      - 6
      inline: false
      attributes: {}
      children:
      - $$mdtype: Node
        errors: []
        lines:
        - 5
        - 6
        inline: false
        attributes: {}
        children:
        - $$mdtype: Node
          errors: []
          lines:
          - 5
          - 6
          inline: true
          attributes:
            content: 'OAuth 2.0 client credentials flow. See '
          children: []
          type: text
          annotations: []
          slots: {}
        - $$mdtype: Node
          errors: []
          lines:
          - 5
          - 6
          inline: true
          attributes:
            href: /getting-started/authentication
          children:
          - $$mdtype: Node
            errors: []
            lines:
            - 5
            - 6
            inline: true
            attributes:
              content: Authentication Guide
            children: []
            type: text
            annotations: []
            slots: {}
          type: link
          annotations: []
          slots: {}
          redocly:::linkOriginal:href: /getting-started/authentication
        - $$mdtype: Node
          errors: []
          lines:
          - 5
          - 6
          inline: true
          attributes:
            content: ' for details.'
          children: []
          type: text
          annotations: []
          slots: {}
        type: inline
        annotations: []
        slots: {}
      type: paragraph
      annotations: []
      slots: {}
servers:
- url: https://api.mvmnt.io/v1
  description: Production
security:
- BearerAuth: []
tags:
- name: Companies
  description: Company management operations
paths:
  /companies/filter:
    post:
      tags:
      - Companies
      summary: Filter companies
      description: 'Query companies using flexible filter criteria with AND/OR logic.


        By default, only non-deleted companies are returned (deletedAt: { isNull: true }).

        Override this by explicitly setting deletedAt filter criteria.

        '
      operationId: filterCompanies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyFilterRequest'
      responses:
        '200':
          description: Filtered companies with pagination
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - pageInfo
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Company'
                  pageInfo:
                    $ref: '#/components/schemas/PaginationInfo'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /companies:
    post:
      tags:
      - Companies
      summary: Create a new company
      description: Create a new company within an organization
      operationId: createCompany
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyInput'
      responses:
        '201':
          description: Company created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /companies/{id}:
    get:
      tags:
      - Companies
      summary: Get a company by ID
      description: Retrieve a single company by its unique identifier
      operationId: getCompanyById
      parameters:
      - $ref: '#/components/parameters/IdOrClientKey'
      responses:
        '200':
          description: Company found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    patch:
      tags:
      - Companies
      summary: Update a company
      description: 'Partially update a company. Only provided fields will be updated.


        - **Omitted fields**: Not modified (current value preserved)

        - **Provided fields**: Updated to the new value

        - **Null values**: Clear the field (set to null) where applicable

        '
      operationId: updateCompany
      parameters:
      - $ref: '#/components/parameters/IdOrClientKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyPatch'
      responses:
        '200':
          description: Company updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - Companies
      summary: Delete a company
      description: 'Soft delete a company (sets deletedAt timestamp).


        The company will no longer appear in default queries but can be retrieved

        by explicitly filtering for deleted records.

        '
      operationId: deleteCompany
      parameters:
      - $ref: '#/components/parameters/IdOrClientKey'
      responses:
        '204':
          description: Company deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CompanyFilterRequest:
      type: object
      description: Request body for filtering companies
      properties:
        filter:
          $ref: '#/components/schemas/CompanyFilter'
          description: 'Filter criteria (optional - omit to return all companies).


            Note: deletedAt automatically defaults to { isNull: true } unless explicitly overridden.

            '
        pageSize:
          type: integer
          minimum: 1
          maximum: 250
          default: 50
          description: Number of results per page
        cursor:
          type: string
          description: Pagination cursor for next page
      example:
        filter:
          and:
          - invoiceOnly:
              equalTo: false
          - name:
              includes: Inc
        pageSize: 50
    ValidationError:
      type: object
      required:
      - error
      - message
      - details
      properties:
        error:
          type: string
          description: Error code
          example: validation_error
        message:
          type: string
          description: Human-readable error message
        details:
          type: array
          description: Validation error details
          items:
            type: object
            required:
            - field
            - message
            properties:
              field:
                type: string
                description: Field name that failed validation
              message:
                type: string
                description: Validation error message
    BooleanFilter:
      type: object
      description: Filter options for boolean fields
      properties:
        equalTo:
          type: boolean
          description: Exact match
        notEqualTo:
          type: boolean
          description: Not equal to
        isNull:
          type: boolean
          description: Field is null (true) or not null (false)
    Error:
      type: object
      required:
      - error
      - message
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
    ClientKeyFilter:
      type: object
      description: Filter options for client key fields (limited operations - exact match only)
      properties:
        equalTo:
          type: string
          description: Exact match
        in:
          type: array
          description: Matches any value in the array
          items:
            type: string
        isNull:
          type: boolean
          description: Field is null (true) or not null (false)
    PaginationInfo:
      type: object
      required:
      - pageSize
      - hasNextPage
      properties:
        pageSize:
          type: integer
          description: Number of items per page
          example: 50
        hasNextPage:
          type: boolean
          description: Whether there are more pages
          example: true
        hasPreviousPage:
          type: boolean
          description: Whether there are previous pages
          example: false
        endCursor:
          type:
          - string
          - 'null'
          description: Cursor for the next page (null if no next page)
          example: eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9
    UUIDFilter:
      type: object
      description: Filter options for UUID fields (all operations)
      properties:
        equalTo:
          type: string
          format: uuid
          description: Exact match
        notEqualTo:
          type: string
          format: uuid
          description: Not equal to
        in:
          type: array
          items:
            type: string
            format: uuid
          description: Matches any UUID in the array
        notIn:
          type: array
          items:
            type: string
            format: uuid
          description: Does not match any UUID in the array
        isNull:
          type: boolean
          description: Field is null (true) or not null (false)
    Company:
      type: object
      required:
      - id
      - name
      - createdAt
      - updatedAt
      properties:
        object:
          type: string
          enum:
          - COMPANY
          readOnly: true
          description: Object type identifier
          example: COMPANY
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique company identifier
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          description: Company legal name
          example: Acme Logistics Inc
        addressLine1:
          type:
          - string
          - 'null'
          description: Primary street address
          example: 123 Main St
        addressLine2:
          type:
          - string
          - 'null'
          description: Secondary address line (suite, floor, etc.)
          example: Suite 400
        city:
          type:
          - string
          - 'null'
          description: City name
          example: Chicago
        country:
          type:
          - string
          - 'null'
          description: Country code or name
          example: USA
        fax:
          type:
          - string
          - 'null'
          description: Fax number
          example: +1-555-0123
        invoiceOnly:
          type:
          - boolean
          - 'null'
          description: Whether this company is used only for invoicing purposes
          example: false
        invoiceVerbiage:
          type:
          - string
          - 'null'
          description: Custom text to include on invoices for this company
          example: Please remit payment within 30 days
        primaryContactName:
          type:
          - string
          - 'null'
          description: Name of primary contact person
          example: John Smith
        primaryContactEmail:
          type:
          - string
          - 'null'
          format: email
          description: Email address of primary contact
          example: john.smith@acmelogistics.com
        primaryContactPhone:
          type:
          - string
          - 'null'
          description: Phone number of primary contact
          example: +1-555-0100
        createdBy:
          anyOf:
          - $ref: '#/components/schemas/UserReference'
          - type: 'null'
          readOnly: true
          description: User who created this company (full user details)
        key:
          type:
          - string
          - 'null'
          maxLength: 512
          description: Client-defined reference identifier
          example: ERP-COMPANY-ACME-001
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: When the company was created
          example: '2025-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          readOnly: true
          description: When the company was last updated
          example: '2025-01-15T14:30:00Z'
        deletedAt:
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
          description: When the company was soft deleted (null if active)
          example: null
    CompanyFilter:
      type: object
      description: Filter criteria for companies with AND/OR logic support
      properties:
        and:
          type: array
          description: All conditions must match (recursive)
          items:
            $ref: '#/components/schemas/CompanyFilter'
        or:
          type: array
          description: At least one condition must match (recursive)
          items:
            $ref: '#/components/schemas/CompanyFilter'
        not:
          $ref: '#/components/schemas/CompanyFilter'
          description: Negates the filter
        id:
          $ref: '#/components/schemas/IDFilter'
        name:
          $ref: '#/components/schemas/StringFilter'
        addressLine1:
          $ref: '#/components/schemas/StringFilter'
        addressLine2:
          $ref: '#/components/schemas/StringFilter'
        city:
          $ref: '#/components/schemas/StringFilter'
        country:
          $ref: '#/components/schemas/StringFilter'
        fax:
          $ref: '#/components/schemas/StringFilter'
        invoiceOnly:
          $ref: '#/components/schemas/BooleanFilter'
        invoiceVerbiage:
          $ref: '#/components/schemas/StringFilter'
        primaryContactName:
          $ref: '#/components/schemas/StringFilter'
        primaryContactEmail:
          $ref: '#/components/schemas/StringFilter'
        primaryContactPhone:
          $ref: '#/components/schemas/StringFilter'
        createdById:
          $ref: '#/components/schemas/UUIDFilter'
        key:
          $ref: '#/components/schemas/ClientKeyFilter'
        createdAt:
          $ref: '#/components/schemas/DatetimeFilter'
        updatedAt:
          $ref: '#/components/schemas/DatetimeFilter'
        deletedAt:
          $ref: '#/components/schemas/DatetimeFilter'
    UserReference:
      type: object
      description: 'Enhanced reference to a user resource (returned in responses).

        Includes full user details in addition to id/key.


        Note: Does NOT include nested references (teams, etc.) to prevent recursion.

        Maximum nesting depth: 1 level.

        '
      required:
      - id
      - email
      - status
      - createdAt
      - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: User UUID
          example: 550e8400-e29b-41d4-a716-446655440000
        key:
          type:
          - string
          - 'null'
          maxLength: 512
          description: Client-defined reference ID if set
          example: ERP-USER-12345
        email:
          type: string
          format: email
          description: User's email address
          example: john.doe@example.com
        name:
          type:
          - string
          - 'null'
          description: User's full name
          example: John Doe
        phone:
          type:
          - string
          - 'null'
          description: User's phone number
          example: +1-555-123-4567
        phoneExt:
          type:
          - string
          - 'null'
          description: Phone extension
          example: '123'
        status:
          type: string
          description: User account status
          enum:
          - PENDING
          - ACTIVE
          - INACTIVE
          example: ACTIVE
        avatarId:
          type:
          - string
          - 'null'
          format: uuid
          description: Profile avatar document ID
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        createdAt:
          type: string
          format: date-time
          description: When the user was created
          example: '2025-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          description: When the user was last updated
          example: '2025-01-15T14:30:00Z'
        deletedAt:
          type:
          - string
          - 'null'
          format: date-time
          description: When the user was soft deleted (null if active)
          example: null
    DatetimeFilter:
      type: object
      description: Filter options for datetime fields
      properties:
        equalTo:
          type: string
          format: date-time
          description: Exact match
        notEqualTo:
          type: string
          format: date-time
          description: Not equal to
        lessThan:
          type: string
          format: date-time
          description: Before this datetime
        lessThanOrEqualTo:
          type: string
          format: date-time
          description: On or before this datetime
        greaterThan:
          type: string
          format: date-time
          description: After this datetime
        greaterThanOrEqualTo:
          type: string
          format: date-time
          description: On or after this datetime
        isNull:
          type: boolean
          description: Field is null (true) or not null (false)
    IDFilter:
      type: object
      description: Filter options for ID fields (limited operations - exact match only)
      properties:
        equalTo:
          type: string
          format: uuid
          description: Exact match
        in:
          type: array
          description: Matches any UUID in the array
          items:
            type: string
            format: uuid
    StringFilter:
      type: object
      description: Filter options for string fields
      properties:
        equalTo:
          type: string
          description: Exact match
        notEqualTo:
          type: string
          description: Not equal to
        in:
          type: array
          items:
            type: string
          description: Matches any value in the array
        notIn:
          type: array
          items:
            type: string
          description: Does not match any value in the array
        includes:
          type: string
          description: Contains substring (case-insensitive)
        notIncludes:
          type: string
          description: Does not contain substring (case-insensitive)
        startsWith:
          type: string
          description: Starts with prefix (case-insensitive)
        notStartsWith:
          type: string
          description: Does not start with prefix (case-insensitive)
        endsWith:
          type: string
          description: Ends with suffix (case-insensitive)
        notEndsWith:
          type: string
          description: Does not end with suffix (case-insensitive)
        isNull:
          type: boolean
          description: Field is null (true) or not null (false)
    CompanyPatch:
      type: object
      description: 'Partial company update. All fields are optional.


        - **Omitted fields**: Not modified (current value preserved)

        - **Provided fields**: Updated to the new value

        - **Null values**: Clear the field (set to null) where applicable

        '
      properties:
        name:
          type: string
          description: Company legal name
          example: Acme Logistics Inc
        addressLine1:
          type:
          - string
          - 'null'
          description: Primary street address
          example: 123 Main St
        addressLine2:
          type:
          - string
          - 'null'
          description: Secondary address line
          example: Suite 400
        city:
          type:
          - string
          - 'null'
          description: City name
          example: Chicago
        country:
          type:
          - string
          - 'null'
          description: Country code or name
          example: USA
        fax:
          type:
          - string
          - 'null'
          description: Fax number
          example: +1-555-0123
        invoiceOnly:
          type:
          - boolean
          - 'null'
          description: Whether this company is used only for invoicing purposes
          example: false
        invoiceVerbiage:
          type:
          - string
          - 'null'
          description: Custom text to include on invoices
          example: Please remit payment within 30 days
        primaryContactName:
          type:
          - string
          - 'null'
          description: Name of primary contact person
          example: John Smith
        primaryContactEmail:
          type:
          - string
          - 'null'
          format: email
          description: Email address of primary contact
          example: john.smith@acmelogistics.com
        primaryContactPhone:
          type:
          - string
          - 'null'
          description: Phone number of primary contact
          example: +1-555-0100
        key:
          type:
          - string
          - 'null'
          maxLength: 512
          description: Client-defined reference identifier
          example: ERP-COMPANY-ACME-001
    CompanyInput:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: Company legal name
          example: Acme Logistics Inc
        addressLine1:
          type: string
          description: Primary street address
          example: 123 Main St
        addressLine2:
          type: string
          description: Secondary address line (suite, floor, etc.)
          example: Suite 400
        city:
          type: string
          description: City name
          example: Chicago
        country:
          type: string
          description: Country code or name
          example: USA
        fax:
          type: string
          description: Fax number
          example: +1-555-0123
        invoiceOnly:
          type: boolean
          description: Whether this company is used only for invoicing purposes
          example: false
        invoiceVerbiage:
          type: string
          description: Custom text to include on invoices for this company
          example: Please remit payment within 30 days
        primaryContactName:
          type: string
          description: Name of primary contact person
          example: John Smith
        primaryContactEmail:
          type: string
          format: email
          description: Email address of primary contact
          example: john.smith@acmelogistics.com
        primaryContactPhone:
          type: string
          description: Phone number of primary contact
          example: +1-555-0100
        key:
          type: string
          maxLength: 512
          description: Client-defined reference identifier
          example: ERP-COMPANY-ACME-001
  responses:
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not_found
            message: Resource not found
    ConflictError:
      description: Conflict - resource already exists or constraint violation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: conflict
            message: A resource with this identifier already exists
    ValidationError:
      description: Validation error - invalid field values
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
          example:
            error: validation_error
            message: Invalid field values
            details:
            - field: email
              message: Must be a valid email address
            - field: status
              message: Must be one of PENDING, ACTIVE, INACTIVE
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_server_error
            message: An unexpected error occurred
    UnauthorizedError:
      description: Unauthorized - invalid or missing access token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            message: Invalid or expired access token
    RateLimitExceeded:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limit_exceeded
            message: Too many requests. Please retry after 60 seconds.
      headers:
        X-RateLimit-Limit:
          description: Request limit per minute
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Remaining requests in current window
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when rate limit resets
          schema:
            type: integer
        Retry-After:
          description: Seconds to wait before retrying
          schema:
            type: integer
    BadRequestError:
      description: Bad request - invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: bad_request
            message: Invalid request parameters
  parameters:
    IdOrClientKey:
      name: id
      in: path
      required: true
      description: Resource ID (UUID) or client key
      schema:
        type: string
      example: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 access token obtained via client credentials flow