<!-- https://staircase.co/agents/roster/workspace-assistant -->
# Workspace assistant

# Workspace assistant

Products

<!--source:agent-kits-->
The assistant inside the internal workspace: answers a reviewer's questions about an application in progress and drafts the message going back to the borrower.
<!--/source-->

- **Used when**
<!--source:agent-kits-->
— While a person is working an application, rather than while a borrower is answering one.
<!--/source-->

- **Collects**
<!--source:agent-kits-->
- The reviewer's question, and the application it is about.
<!--/source-->

- **Returns**
<!--source:agent-kits-->
- The answer, and the draft reply for the reviewer to send or edit.
<!--/source-->

- **Evidence**
- `aira`
- `aira-messaging`

## Operations

<!--source:api-specifications-->

### Workspaces
<!--/source-->

`POST` `/`

<!--source:api-specifications-->

#### Create a new workspace
<!--/source-->

`createWorkspace`

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "Agent",
 "default_assistant": {"assistant_name": "leadsGeneric", "context_message": "Questions related to leads."},
 "assistants": [
 {"assistant_name": "SendEmail", "context_message": "Questions related to sending emails."},
 {"assistant_name": "GeneratePostcard", "context_message": "Questions related to generating postcards."}
 ]
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Name of the workspace<!--/source--> |
| `default_assistant` | `object` | <!--source:api-specifications-->Assistant object<!--/source--> |
| `assistant_name` | `string` | <!--source:api-specifications-->Name of the assistant<!--/source--> |
| `context_message` | `string` | <!--source:api-specifications-->Context message for the assistant<!--/source--> |
| `assistants`required | `array` | <!--source:api-specifications-->List of assistants for the workspace<!--/source--> |
| `routing_model` | `string` | <!--source:api-specifications-->Routing model. Only GPT-4o and later models are supported. GPT4-4o mini is also supported.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Name of the workspace<!--/source--> |
| `default_assistant` | `object` | <!--source:api-specifications-->Assistant object<!--/source--> |
| `assistant_name` | `string` | <!--source:api-specifications-->Name of the assistant<!--/source--> |
| `context_message` | `string` | <!--source:api-specifications-->Context message for the assistant<!--/source--> |
| `assistants`required | `array` | <!--source:api-specifications-->List of assistants for the workspace<!--/source--> |
| `routing_model` | `string` | <!--source:api-specifications-->Routing model. Only GPT-4o and later models are supported. GPT4-4o mini is also supported.<!--/source--> |

`GET` `/{workspace_name}`

<!--source:api-specifications-->

#### Get a workspace
<!--/source-->

`getWorkspace`

<!--source:api-specifications-->
Get a workspace by name

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `workspace_name` required | `string` path | `my-workspace` | <!--source:api-specifications-->Name of the workspace<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Name of the workspace<!--/source--> |
| `default_assistant` | `object` | <!--source:api-specifications-->Assistant object<!--/source--> |
| `assistant_name` | `string` | <!--source:api-specifications-->Name of the assistant<!--/source--> |
| `context_message` | `string` | <!--source:api-specifications-->Context message for the assistant<!--/source--> |
| `assistants`required | `array` | <!--source:api-specifications-->List of assistants for the workspace<!--/source--> |
| `routing_model` | `string` | <!--source:api-specifications-->Routing model. Only GPT-4o and later models are supported. GPT4-4o mini is also supported.<!--/source--> |

<!--source:api-specifications-->

### AIRA Messaging
<!--/source-->

`POST` `/messaging/{workspace_name}/messages`

<!--source:api-specifications-->

#### Send message
<!--/source-->

`sendMessage`

<!--source:api-specifications-->
Send a message to the AIRA workspace
<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "connection_id": "123",
 "x-sc-trace-id": "123",
 "message": [
 {
 "type": "text",
 "text": "Hello"
 }
 ],
 "payload": {
 "person_identifier": "123",
 "regenerate_response": true
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `workspace_name` required | `string` path | `workspace` | <!--source:api-specifications-->The name of the workspace<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `connection_id`required | `string` | <!--source:api-specifications-->The connection id<!--/source--> |
| `x-sc-trace-id` | `string` | <!--source:api-specifications-->The trace id<!--/source--> |
| `message`required | `object[]` | <!--source:api-specifications-->The message to send<!--/source--> |
| `type`required | `string` | <!--source:api-specifications-->The type of the message<!--/source-->`text` |
| `text`required | `string` | <!--source:api-specifications-->The content of the message<!--/source--> |
| `payload`required | `object` | <!--source:api-specifications-->The payload<!--/source--> |
| `person_identifier`required | `string` | <!--source:api-specifications-->The person identifier<!--/source--> |
| `regenerate_response` | `boolean` | <!--source:api-specifications-->Regenerate the response<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->The error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->The error message<!--/source--> |

##### Other responses

`200`

`GET` `/messaging/{connection_id}/messages`

<!--source:api-specifications-->

#### List messages by connection ID
<!--/source-->

`listMessages`

<!--source:api-specifications-->
List messages
<!--/source-->

<!--source:api-specifications-->
List messages by connection id

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Messages history

```
{
 "messages": [
 {
 "role": "user",
 "content": "Hello"
 },
 {
 "role": "assistant",
 "content": "Hi"
 }
 ],
 "openai_thread_id": "123"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `connection_id` required | `string` path | `dfYn_eqooAMCFDA=` | <!--source:api-specifications-->The connection id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Messages history
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `messages` | `object[]` | <!--source:api-specifications-->The messages<!--/source--> |
| `role` | `string` | <!--source:api-specifications-->The role<!--/source-->`user``assistant` |
| `content` | `string` | <!--source:api-specifications-->The content<!--/source--> |
| `openai_thread_id` | `string` | <!--source:api-specifications-->The openai thread id<!--/source--> |

<!--source:api-specifications-->

### Route
<!--/source-->

`POST` `/{workspace_name}/route`

<!--source:api-specifications-->

#### Process route request
<!--/source-->

`processRouteRequest`

<!--source:api-specifications-->
Process a route request
<!--/source-->

<!--source:api-specifications-->
Process a route request for the specified workspace

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "message_history": [{"role": "System", "content": ""}, {"role": "System", "content": ""}],
 "input_text": ""
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `workspace_name` required | `string` path | `my-workspace` | <!--source:api-specifications-->Name of the workspace to route the request to<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `input_text` | `string` | <!--source:api-specifications-->Input text for the route<!--/source--> |
| `message_history` | `object[]` | <!--source:api-specifications-->Message history<!--/source--> |
| `role` | `string` | <!--source:api-specifications-->Role of the message<!--/source-->`assistant``user` |
| `content` | `string` | <!--source:api-specifications-->Text of the message<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `openai_assistant_id` | `string` | <!--source:api-specifications-->OpenAI assistant ID<!--/source--> |
| `configuration_id` | `string` | <!--source:api-specifications-->Configuration ID<!--/source--> |
| `assistant_name` | `string` | <!--source:api-specifications-->Staircase assistant name<!--/source--> |

## Others in Products

- Application document
- Assets
- Co-borrower invitation
- Contact details
- Correction
- Credit
- Declarations
- Demographic details
- Employment and income
- Frequently-asked questions
- Gifts and grants
- Liabilities
- Loan lookup
- Military service
- Mortgage details
- Other income
- Personal identity
- Preapproval letter
- Pricing
- Rate estimate
- Real estate owned
- Residency
- Self-employment income
