> For the complete documentation index, see [llms.txt](https://academy.synap.ac/organisation-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.synap.ac/organisation-api/api-reference/sso-login.md).

# /sso/login

## Login

<mark style="color:green;">`POST`</mark> `https://api-org.synap.ac/sso/login`

When passed a valid user's email you will receive an authenticated URL.

#### Headers

| Name             | Type   | Description                                                    |
| ---------------- | ------ | -------------------------------------------------------------- |
| x-api-key        | string | Your API usage token.                                          |
| x-syn-org-id     | string | Your organisation's identifier on Synap.                       |
| x-syn-org-secret | string | Your organisation"s secret key, used to authorise each request |
| content-type     | string | application/json                                               |

{% tabs %}
{% tab title="200 Authentication successful." %}

```
{ "authenticatedURL": "https://example.synap.ac?st=< SESSION TOKEN >" }
```

{% endtab %}

{% tab title="401 An invalid user email is passed to the API" %}

```
{ "message": "you do not have permission to perform this operation" }
```

{% endtab %}

{% tab title="403 Your organisation secret key or api usage key is incorrect or has not been provided" %}

```
{ "message": "you do not have permission to perform this operation" }
```

{% endtab %}
{% endtabs %}

#### Body Parameters

User

| Attribute | Type   | Required | Description              |
| --------- | ------ | -------- | ------------------------ |
| email     | string | yes      | The user's email address |

#### Examples

{% tabs %}
{% tab title="cURL Request" %}

```typescript
curl --request POST \
  --url https://api-org.synap.ac/sso/login \
  --header 'content-type: application/json' \
  --header 'x-syn-org-id: org123test' \
  --header 'x-syn-org-secret: secret123test' \
  --header 'x-api-key: test123api' \
  --data '{
	"user": {
		"email": "tAEsxtymcctest@test.co.uk"
	}
}'
```

{% endtab %}

{% tab title="Request Body" %}

```typescript
{
   "user": {
      "email": "tomsmith@test.com"
   }
}
```

{% endtab %}

{% tab title="Response" %}

```typescript
200 OK
{
    "authenticatedURL": "https://yourPortalURL.ac?st=r:123sessiontoken567"
    "timestamp": "2020-03-30T10:05:16.754Z"
}

--

403 Forbidden
{
  "code": 403,
  "error": "Unauthorised request."
}

--

401 Unauthorized
{ 
  "code": 401, 
  "error": "Object not found."
}
```

{% endtab %}
{% endtabs %}
