github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/invitations/create.yaml (about)

     1  ---
     2  summary: Create a new invitation
     3  description: Invite a person to an account. Developers and translators need <code>project_ids</code> and <code>locale_ids</code> assigned to access them. Access token scope must include <code>team.manage</code>.
     4  operationId: invitation/create
     5  tags:
     6  - Invitations
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/account_id"
    10  responses:
    11    '201':
    12      description: Created
    13      content:
    14        application/json:
    15          schema:
    16            "$ref": "../../schemas/invitation.yaml#/invitation"
    17      headers:
    18        X-Rate-Limit-Limit:
    19          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    20        X-Rate-Limit-Remaining:
    21          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    22        X-Rate-Limit-Reset:
    23          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    24    '400':
    25      "$ref": "../../responses.yaml#/400"
    26    '401':
    27      "$ref": "../../responses.yaml#/401"
    28    '403':
    29      "$ref": "../../responses.yaml#/403"
    30    '404':
    31      "$ref": "../../responses.yaml#/404"
    32    '422':
    33      "$ref": "../../responses.yaml#/422"
    34    '429':
    35      "$ref": "../../responses.yaml#/429"
    36  x-code-samples:
    37  - lang: Curl
    38    source: |-
    39      curl "https://api.phrase.com/v2/accounts/:account_id/invitations" \
    40        -u USERNAME_OR_ACCESS_TOKEN \
    41        -X POST \
    42        -d '{"email":"example@mail.com","role":"Developer","project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235","space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],"team_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],"default_locale_codes":["de","en"],"permissions":{"create_upload":true,"review_translations":true}}' \
    43        -H 'Content-Type: application/json'
    44  - lang: CLI v2
    45    source: |-
    46      phrase invitations create \
    47      --account_id <account_id> \
    48      --data '{"email":"example@mail.com", "role":"Developer", "project_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "locale_ids":"abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235", "space_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],"team_ids":["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"], "default_locale_codes":["de","en"], "permissions":"{"create_upload"=>true, "review_translations"=>true}"}' \
    49      --access_token <token>
    50  requestBody:
    51    required: true
    52    content:
    53      application/json:
    54        schema:
    55          type: object
    56          title: invitation/create/parameters
    57          required:
    58            - email
    59            - role
    60          properties:
    61            email:
    62              description: The email of the invited user. The <code>email</code> can not be updated once created. Create a new invitation for each unique email.
    63              type: string
    64              example: example@mail.com
    65            role:
    66              description: Invitiation role, can be any of Manager, Developer, Translator.
    67              type: string
    68              example: Developer
    69            project_ids:
    70              description: List of project ids the invited user has access to.
    71              type: string
    72              example: abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235
    73            locale_ids:
    74              description: List of locale ids the invited user has access to.
    75              type: string
    76              example: abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235
    77            space_ids:
    78              description: List of spaces the user is assigned to.
    79              type: array
    80              items:
    81                type: string
    82              example:
    83              - abcd1234abcd1234abcd1234
    84              - abcd1234abcd1234abcd1235
    85            team_ids:
    86              description: List of teams the user is assigned to.
    87              type: array
    88              items:
    89                type: string
    90              example:
    91              - abcd1234abcd1234abcd1234
    92              - abcd1234abcd1234abcd1235
    93            default_locale_codes:
    94              description: List of default locales for the user.
    95              type: array
    96              items:
    97                type: string
    98              example:
    99              - en
   100              - de
   101            permissions:
   102              description: Additional permissions depending on invitation role. Available permissions are <code>create_upload</code> and <code>review_translations</code>
   103              type: object
   104              additionalProperties:
   105                type: string
   106              example:
   107                create_upload: true
   108                review_translations: true
   109  x-cli-version: '2.5'