# Profile API

{% hint style="success" %}
If you use the [JavaScript SDK](https://dev.vulos.io/reference/identity-javascript-sdk) you could use the [`ProfileApi`](https://dev.vulos.io/reference/identity-javascript-sdk/the-base-package/profile/profileapi) abstraction instead.
{% endhint %}

{% hint style="warning" %}
You need the [`profile:read`](https://dev.vulos.io/identity/scopes-and-claims#profile-read) scope to access this API.
{% endhint %}

## User Profile

<mark style="color:blue;">`GET`</mark> `https://identity.vulos.io/api/v1/profile/:id`

Get the user's public profile information.

#### Path Parameters

| Name                                 | Type   | Description   |
| ------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark> | String | The user's ID |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

{% tabs %}
{% tab title="400: Bad Request Error response" %}

```json
{
    "error": "Something went wrong",
    "code": "<errror code>",
    "request": "<request id>"
}
```

{% endtab %}

{% tab title="401: Unauthorized Empty body" %}

```javascript
```

{% endtab %}

{% tab title="200: OK The user's public profile" %}

```javascript
{
    "firstName": "John",
    "lastName": "Doe"
}
```

{% endtab %}
{% endtabs %}

## Organization Profile

<mark style="color:blue;">`GET`</mark> `https://identity.vulos.io/api/v1/profile/organization/:id`

Get the organization's public profile information.

#### Path Parameters

| Name                                 | Type   | Description                |
| ------------------------------------ | ------ | -------------------------- |
| id<mark style="color:red;">\*</mark> | String | The ID of the organization |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

{% tabs %}
{% tab title="200: OK The organization's public profile" %}

```javascript
{
    "name": "Example",
    "address": "Example Address",
    "city": "Example Test",
    "country": "Example Country Name",
    "state": "Example State Name",
    "website": "https://example.com",
    "verified": false,
    "uniqueId": "<example unique id>",
    "zipCode": "<example zip code>"
}
```

{% endtab %}

{% tab title="400: Bad Request Error response" %}

```javascript
{
    "error": "Something went wrong",
    "code": "<errror code>",
    "request": "<request id>"
}
```

{% endtab %}

{% tab title="401: Unauthorized Empty body" %}

```javascript
```

{% endtab %}
{% endtabs %}

## Search Organizations

<mark style="color:blue;">`GET`</mark> `https://identity.vulos.io/api/v1/profile/organization/search/:search/:amount/:offset`

Search for an organization by name.

#### Path Parameters

| Name                                     | Type   | Description                                                                             |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| search<mark style="color:red;">\*</mark> | String | The keyword to find in the organization's name                                          |
| amount                                   | String | The maximal amount of organizations to return (defaults to `10`, it's limited to `100`) |
| offset                                   | String | The amount of organizations to skip (defaults to `0`)                                   |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

{% tabs %}
{% tab title="200: OK An array of organization profiles with an ID" %}

```javascript
[
    {
        "id": 1,
        "name": "Example"
        // additional public profile data
    },
    {
        "id": 2,
        "name": "Scond Example"
    }
]
```

{% endtab %}

{% tab title="400: Bad Request Empty body" %}

```javascript
```

{% endtab %}

{% tab title="401: Unauthorized Empty body" %}

```javascript
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.vulos.io/reference/profile-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
