# Access

## Get access

> Retrieves all users that have access to the merchant's company

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}},"schemas":{"Pagination":{"type":"object","description":"Pagination metadata","properties":{"current_page":{"type":"number"},"next_page":{"type":"number"},"prev_page":{"type":"number"}}},"UserAccess":{"description":"An instance company-level user access","type":"object","properties":{"id":{"type":"string","description":"The user id"},"email":{"type":"string","description":"The user email address","format":"email"},"first_name":{"type":"string","description":"The user first name, optional"},"last_name":{"type":"string","description":"The user last name, optional"},"role":{"description":"The user's role in the company.","type":"string","enum":["OWNER","ADMIN"]},"is_active":{"type":"boolean","description":"Access is active or not"},"created_by":{"type":"object","description":"The user that granted access to this user, optional.","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}},"paths":{"/portal/instance/access/users":{"get":{"summary":"Get access","description":"Retrieves all users that have access to the merchant's company","parameters":[{"in":"query","name":"merchant_id","schema":{"type":"string","description":"Either a merchant ID or a domain ID is required"}},{"in":"query","name":"domain_id","schema":{"type":"string"}}],"responses":{"200":{"description":"An array with all users","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Pagination"},"result":{"type":"array","items":{"$ref":"#/components/schemas/UserAccess"}}}}}}}}}}}}
```

## Grant access

> Grant company access to the specified user with the specified role. The system will send an invitation email to the newly created user.

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}},"schemas":{"UserAccess":{"description":"An instance company-level user access","type":"object","properties":{"id":{"type":"string","description":"The user id"},"email":{"type":"string","description":"The user email address","format":"email"},"first_name":{"type":"string","description":"The user first name, optional"},"last_name":{"type":"string","description":"The user last name, optional"},"role":{"description":"The user's role in the company.","type":"string","enum":["OWNER","ADMIN"]},"is_active":{"type":"boolean","description":"Access is active or not"},"created_by":{"type":"object","description":"The user that granted access to this user, optional.","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}},"paths":{"/portal/instance/access/users":{"post":{"summary":"Grant access","description":"Grant company access to the specified user with the specified role. The system will send an invitation email to the newly created user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The target email address"},"role":{"type":"string","enum":["OWNER","ADMIN"],"description":"The role the user will be granted in the company."}},"required":["email","role"]}}}},"responses":{"200":{"description":"Merchant added to the partner account","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/UserAccess"}}}}}}}}}}}
```

## Provision access

> Instantly provision the specified user and role in the company and return a magic link. This performs just-in-time user access creation or access updating.

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}}},"paths":{"/portal/instance/access/users/provision":{"post":{"summary":"Provision access","description":"Instantly provision the specified user and role in the company and return a magic link. This performs just-in-time user access creation or access updating.","parameters":[{"in":"query","name":"merchant_id","schema":{"type":"string","description":"Either a merchant ID or a domain ID is required"}},{"in":"query","name":"domain_id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email account of the user you want to provision"},"role":{"description":"The role to assign to the specified user","type":"string","enum":["OWNER","ADMIN"]},"access_switch":{"type":"boolean","default":true,"description":"Set this field to false to disable switching between companies for the target user."}},"required":["email","role"]}}}},"responses":{"200":{"description":"The user access information and authentication information","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"string","description":"The provisioned account id"},"email":{"type":"string","format":"email","description":"The provisioned account email"},"role":{"type":"string","description":"The provisioned account role","enum":["OWNER","ADMIN"]},"is_active":{"type":"boolean"},"login_url":{"type":"string","format":"uri","description":"The magic link that can be returned to the user in order for them to authenticate to their account."}}}}}}}}}}}}}
```

## Get access

> Retrieve information about a user's access

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}},"schemas":{"UserAccess":{"description":"An instance company-level user access","type":"object","properties":{"id":{"type":"string","description":"The user id"},"email":{"type":"string","description":"The user email address","format":"email"},"first_name":{"type":"string","description":"The user first name, optional"},"last_name":{"type":"string","description":"The user last name, optional"},"role":{"description":"The user's role in the company.","type":"string","enum":["OWNER","ADMIN"]},"is_active":{"type":"boolean","description":"Access is active or not"},"created_by":{"type":"object","description":"The user that granted access to this user, optional.","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}},"paths":{"/portal/instance/access/users/{userId}":{"get":{"summary":"Get access","description":"Retrieve information about a user's access","parameters":[{"in":"query","name":"merchant_id","schema":{"type":"string","description":"Either a merchant ID or a domain ID is required"}},{"in":"query","name":"domain_id","schema":{"type":"string"}},{"name":"userId","in":"path","description":"User id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The user access information","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/UserAccess"}}}}}}}}}}}
```

## Update access

> Update access information for the specified user

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}}},"paths":{"/portal/instance/access/users/{userId}":{"put":{"summary":"Update access","description":"Update access information for the specified user","parameters":[{"in":"query","name":"merchant_id","schema":{"type":"string","description":"Either a merchant ID or a domain ID is required"}},{"in":"query","name":"domain_id","schema":{"type":"string"}},{"name":"userId","in":"path","description":"User id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"description":"The new role to assign to the user","type":"string","enum":["OWNER","ADMIN"]},"is_active":{"type":"boolean","description":"Enables or disables the user's access in the company."}}}}}},"responses":{"200":{"description":"Acknowledgement that request was successful.","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```

## Delete access

> Removes the specified user's access in the company.

```json
{"openapi":"3.0.3","info":{"title":"Instance Access Partner API","version":"1.0"},"servers":[{"url":"https://partners.clym.io/api"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key generated in Clym Partner Portal."}}},"paths":{"/portal/instance/access/users/{userId}":{"delete":{"summary":"Delete access","description":"Removes the specified user's access in the company.","parameters":[{"in":"query","name":"merchant_id","schema":{"type":"string","description":"Either a merchant ID or a domain ID is required"}},{"in":"query","name":"domain_id","schema":{"type":"string"}},{"name":"userId","in":"path","description":"User id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User access deletion confirmation","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}}}}
```


---

# 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://docs.clym.io/api-reference/instance/access.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.
