# Log in as Workspace

- Operation ID: `profileLogin`
- HTTP method: `POST`
- Path: `/uauth/v2/auth/login/profile`
- [Human-readable API reference](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /uauth/v2/auth/login/profile:
    post:
      summary: Log in as Workspace
      description: |
        Obtain a new Workspace JWT Token.

        ---

        **Authentication:** Not required
      tags:
        - Authorization
      operationId: profileLogin
      requestBody:
        content:
          application/json:
            schema:
              required:
                - apiKey
              type: object
              properties:
                apiKey:
                  type: string
                  description: |
                    Workspace API key

                    <span style="color:red"><strong>WARNING:</strong></span> Workspace API keys can be used to access all customer data and manage the workspace. They should only be used for server-to-server communication in integrations. **DO NOT use workspace API keys in your mobile applications or websites**.
                  example: 64c09614-1b2a-42f7-804d-f647243eb1ab
        required: true
      responses:
        "200":
          description: New JWT token for Workspace authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: "[JWT](https://jwt.io) token"
        "400":
          description: Request malformed
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    format: date-time
                    description: Time when the error occurred
                  status:
                    type: integer
                    description: Status code
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  path:
                    type: string
                    description: URL of the requested resource
        "401":
          description: Unauthorized, API key does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    format: date-time
                    description: Time when the error occurred
                  status:
                    type: integer
                    description: Status code
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  path:
                    type: string
                    description: URL of the requested resource
      x-snr-doc-urls:
        - /api-reference/authorization#tag/Authorization/operation/profileLogin
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/uauth/v2/auth/login/profile \
              --header 'content-type: application/json' \
              --data '{"apiKey":"64c09614-1b2a-42f7-804d-f647243eb1ab"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"apiKey\":\"64c09614-1b2a-42f7-804d-f647243eb1ab\"}"

            headers = { 'content-type': "application/json" }

            conn.request("POST", "/uauth/v2/auth/login/profile", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "apiKey": "64c09614-1b2a-42f7-804d-f647243eb1ab"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/uauth/v2/auth/login/profile");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/uauth/v2/auth/login/profile",
              "headers": {
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({apiKey: '64c09614-1b2a-42f7-804d-f647243eb1ab'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/uauth/v2/auth/login/profile');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"apiKey":"64c09614-1b2a-42f7-804d-f647243eb1ab"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/uauth/v2/auth/login/profile")
              .header("content-type", "application/json")
              .body("{\"apiKey\":\"64c09614-1b2a-42f7-804d-f647243eb1ab\"}")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Authorization
```
