> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datanumia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a job

> This API manages the lifecycle of multiple persons, sites and service offers in a single batch.

It decompress the .tar.gz archive, and process each json file contained in the archive. Only the .tar.gz format is valid.
No order is guaranteed for the file processing order nor the order of processing of requests within a file.
Each file in the archive is a JSON file with format of the RequestsFileContent schema described in this document.
RequestsFileContent can contain a maximum of 10.000 requests.

A global error is returned in the following situation:
  - invalid archive format
  - invalid archive content
This API returns a URl to access the job status.




## OpenAPI

````yaml /api-reference/persons-sites-service-offers.yaml post /smt-jobs
openapi: 3.0.3
info:
  title: Person, Site and Service Offer lifecycle
  description: >
    This API manages the lifecycle of persons, sites and service offers as
    described
    [here](https://datanumia.stoplight.io/docs/DatanumiaHome/YXBpOjQ0ODQzMjMy-person-site-and-service-offer-lifecycle)

    Please refer to the following link to get a better understanding of the
    [core
    concepts](https://datanumia.stoplight.io/docs/DatanumiaHome/ZG9jOjM4MDg2NDE5-core-concepts)
    of the Home platform.


    <b>Important notice with regard to those APIs:</b>

    - When subscribing or deleting multiple subscribed offers on a site or
    subscribed offers on multiple sites please provide all sites and subscribe
    offer data in a single POST subscriptions call.

    - They are idempotent. Launching multiple times the same operation will lead
    to the same result

    - They require a complete snapshot of all the objects involved in the
    operation. Those new objects overwrite the existing one. In other words,
    missing properties will be considered empty or null when operations will be
    executed on existing person/site objects
  termsOfService: TODO
  contact:
    email: api@datanumia.com
  version: 2.0.0
servers:
  - url: https://api.home.datanumia.com/api/v2
    description: Production Server
security: []
paths:
  /smt-jobs:
    post:
      tags:
        - bulk mode smt
      summary: Submit a job
      description: >
        This API manages the lifecycle of multiple persons, sites and service
        offers in a single batch.


        It decompress the .tar.gz archive, and process each json file contained
        in the archive. Only the .tar.gz format is valid.

        No order is guaranteed for the file processing order nor the order of
        processing of requests within a file.

        Each file in the archive is a JSON file with format of the
        RequestsFileContent schema described in this document.

        RequestsFileContent can contain a maximum of 10.000 requests.


        A global error is returned in the following situation:
          - invalid archive format
          - invalid archive content
        This API returns a URl to access the job status.
      operationId: bulkOperation
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >
                    A .tar.gz archive containing the The json files to be
                    processed.


                    Each json file must respect the the
                    [RequestsFileContent](/api-reference/schema/RequestsFileContent)
                    schema described in this document.
        required: true
      responses:
        '200':
          description: bulk mode response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MassRequestsResponse'
        '400':
          description: Functional Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errorCode: INVALID_AUTHORIZATION_HEADER_VALUE
                errorDescription: The Authorization header is invalid
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errorCode: ACCESS_DENIED
                errorDescription: >-
                  The Authorization token does not have permission to the
                  resource
        '500':
          description: Server error
          content: {}
      security:
        - Bearer:
            - home:referential:smt-jobs:write
components:
  schemas:
    MassRequestsResponse:
      description: Return a job id that can be used to track the job execution status
      required:
        - jobStatusURL
      type: object
      properties:
        _links:
          $ref: '#/components/schemas/JobLinks'
    ErrorResponse:
      required:
        - errorCode
        - errorDescription
      type: object
      properties:
        errorCode:
          description: The error code. Refer to the table bellow
          type: string
        errorDescription:
          type: string
          description: The error description
      description: ErrorResponse
    JobLinks:
      required:
        - self
      type: object
      properties:
        self:
          $ref: '#/components/schemas/JobLinkSelf'
    JobLinkSelf:
      required:
        - href
      type: object
      properties:
        href:
          type: string
          example: https://<DATANUMIA_ROOT_URL>/smt-jobs/{job-id}
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````