---
agentTools:
  projectIndex: https://troops.readme.io/llms.txt
---

# Create Commercials

Creates a new commercial

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Introduction",
    "version": "1.0.0",
    "description": "The Troops Integration API is organized around\n[REST](https://en.wikipedia.org/wiki/Representational_state_transfer). It\nallows you to query and manipulate the following resources within your TEA\ntree:\n\n- Candidates and their related assets.\n- TEAs\n- Certain references:\n  - Business sectors\n  - Countries\n  - Jobs\n- Paychecks\n- Evolia syncing\n"
  },
  "paths": {
    "/api/integrations/commercials": {
      "post": {
        "tags": [
          "Commercials"
        ],
        "description": "Creates a new commercial",
        "operationId": "Create Commercials",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tea": {
                    "type": "string",
                    "format": "uuid",
                    "example": "2122ba6d-567d-3a90-93e8-22c1761e7f1a",
                    "description": "UUID of staffing agency    \nID value should be obtained from the <a href=\"/#/Staffing Agencies/List Staffing Agencies\">reference list of agencies</a> for your staffing agency group\n"
                  },
                  "commercials": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "external_id": {
                          "type": "string",
                          "description": "External reference (e.g. Evolia ID)"
                        },
                        "title": {
                          "type": "string"
                        },
                        "email": {
                          "$ref": "#/components/schemas/Email"
                        }
                      },
                      "required": [
                        "email",
                        "title",
                        "external_id"
                      ]
                    },
                    "description": "Array of commercials to import"
                  },
                  "fail_strategy": {
                    "type": "string",
                    "enum": [
                      "allow_warnings",
                      "skip_candidates_with_warnings",
                      "rollback_on_warnings"
                    ],
                    "description": "Manages how import batch will be processed:\n\n- `allow_warnings`: will import as much commercials as possible, despite any warnings during the process\n- `skip_candidates_with_warnings`: will skip commercials with warnings\n- `rollback_on_warnings`: will revert whole batch if it contains any commercial with warnings.\n\nBy default `allow_warnings` strategy will be used\n"
                  }
                },
                "required": [
                  "tea",
                  "commercials"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Returned in case the request was handled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceId"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Create Commercials"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "The entire API is authenticated, so to use it you will require an API\nkey. To acquire one, please send a request to your account manager at\nTroops or to help@troops.fr.\n\nWhen making requests, you need to specify the API key using the Bearer\nscheme in the Authorization header, e.g. `Authorization: Bearer\nthis-is-my-secret-token`.\n\nYour API keys carry many privileges, so be sure to keep them secure! Do\nnot share your secret API keys in publicly accessible areas such as\nGitHub, client-side code, and so forth.\n\nAll API requests must be made over HTTPS. Calls made over plain HTTP\nwill fail. API requests without authentication will also fail.\n"
      }
    },
    "schemas": {
      "UUID": {
        "type": "string",
        "format": "uuid",
        "description": "UUID",
        "example": "123e4567-e89b-12d3-a456-426655440000"
      },
      "Email": {
        "type": "string",
        "format": "email",
        "example": "some@troops.online"
      },
      "ResourceId": {
        "type": "object",
        "description": "Resource Identifier. One of properties \"id\" or \"uuid\" might be null.",
        "properties": {
          "uuid": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UUID"
              },
              {
                "type": "string",
                "nullable": true,
                "example": null
              }
            ]
          },
          "id": {
            "anyOf": [
              {
                "type": "integer",
                "example": 2
              },
              {
                "type": "integer",
                "nullable": true,
                "example": null
              },
              {
                "$ref": "#/components/schemas/UUID"
              },
              {
                "type": "string",
                "nullable": true,
                "example": null
              }
            ]
          }
        },
        "example": {
          "id": null,
          "uuid": "123e4567-e89b-12d3-a456-426655440000"
        }
      }
    },
    "responses": {
      "NotFound": {
        "description": "Returned in case the requested item can not be found"
      },
      "BadRequest": {
        "description": "Returned in case the request contained invalid parameters"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api-staging.troops.fr",
      "description": "PreProduction (Staging) server"
    },
    {
      "url": "https://api.troops.fr",
      "description": "Production server"
    },
    {
      "url": "https://api-dev.troops.online",
      "description": "Development server"
    },
    {
      "url": "https://api-{envID}.troops.online",
      "description": "Development server (Dynamic feature env)",
      "variables": {
        "envID": {
          "default": "dev",
          "description": "dev, r-********, 1202004111967626"
        }
      }
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 184,
      "2": 241,
      "3": 90,
      "4": 97,
      "5": 249,
      "6": 184,
      "7": 0,
      "8": 76,
      "9": 125,
      "10": 22,
      "11": 209
    }
  }
}
```