# get\_\_workspace\_{workspaceId}

`GET /workspace/{id}`

*Get Workspace by ID*

Retrieve a specific workspace by its ID. The user must have access to the workspace (READ, WRITE, or ADMIN role) to retrieve its details.

#### TypeScript Client Library

```typescript
public getWorkspace = async (id: string): Promise<WorkspaceTypes.GetWorkspaceResponse> => {
  return this.makeRequest<WorkspaceTypes.GetWorkspaceResponse>(`workspace/${id}`, 'GET', null);
};
```

#### Code Samples

{% tabs %}
{% tab title="Shell" %}

```shell
# You can also use wget
curl -X GET https://backend.flashback.tech/workspace/123e4567-e89b-12d3-a456-426614174000 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'
```

{% endtab %}

{% tab title="HTTP" %}

```http
GET https://backend.flashback.tech/workspace/123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: backend.flashback.tech
Accept: application/json
Authorization: Bearer {access-token}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const workspaceId = '123e4567-e89b-12d3-a456-426614174000';
const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch(`https://backend.flashback.tech/workspace/${workspaceId}`,
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'

workspace_id = '123e4567-e89b-12d3-a456-426614174000'
headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get "https://backend.flashback.tech/workspace/#{workspace_id}",
  headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

workspace_id = '123e4567-e89b-12d3-a456-426614174000'
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get(f'https://backend.flashback.tech/workspace/{workspace_id}', 
                 headers=headers)

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$workspace_id = '123e4567-e89b-12d3-a456-426614174000';
$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

try {
    $response = $client->request('GET',"https://backend.flashback.tech/workspace/{$workspace_id}", array(
        'headers' => $headers,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }
```

{% endtab %}

{% tab title="Java" %}

```java
String workspaceId = "123e4567-e89b-12d3-a456-426614174000";
URL obj = new URL("https://backend.flashback.tech/workspace/" + workspaceId);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "net/http"
       "fmt"
)

func main() {
    workspaceId := "123e4567-e89b-12d3-a456-426614174000"
    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    req, err := http.NewRequest("GET", fmt.Sprintf("https://backend.flashback.tech/workspace/%s", workspaceId), nil)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

#### Parameters <a href="#get__workspace_workspaceid-parameters" id="get__workspace_workspaceid-parameters"></a>

| Name | In   | Type   | Required | Description                            |
| ---- | ---- | ------ | -------- | -------------------------------------- |
| id   | path | string | true     | The unique identifier of the workspace |

#### Path Parameters <a href="#get__workspace_workspaceid-path-parameters" id="get__workspace_workspaceid-path-parameters"></a>

| Name | Type   | Required | Restrictions | Description                            |
| ---- | ------ | -------- | ------------ | -------------------------------------- |
| id   | string | true     | none         | The unique identifier of the workspace |

> Example responses

> 200 Response

```json
{
  "success": true,
  "workspace": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Development Workspace",
    "orgId": "987fcdeb-51a2-43d1-9f12-345678901234",
    "users": [
      {
        "userId": "user-123",
        "role": "ADMIN",
        "user": {
          "id": "user-123",
          "name": "John",
          "lastName": "Doe",
          "email": "john.doe@example.com",
          "orgRole": 1
        }
      },
      {
        "userId": "user-456",
        "role": "WRITE",
        "user": {
          "id": "user-456",
          "name": "Jane",
          "lastName": "Smith",
          "email": "jane.smith@example.com",
          "orgRole": 2
        }
      }
    ]
  }
}
```

> 404 Response

```json
{
  "success": false,
  "message": "User not found"
}
```

> 404 Response

```json
{
  "success": false,
  "message": "Workspace not found or access denied"
}
```

> 500 Response

```json
{
  "success": false,
  "message": "Failed to fetch workspace"
}
```

#### Responses <a href="#get__workspace_workspaceid-responses" id="get__workspace_workspaceid-responses"></a>

| Status | Meaning                                                                    | Description                                         | Schema |
| ------ | -------------------------------------------------------------------------- | --------------------------------------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                    | Workspace retrieved successfully                    | Inline |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)             | User not found or workspace not found/access denied | Inline |
| 500    | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Server error                                        | Inline |

#### Response Schema <a href="#get__workspace_workspaceid-responseschema" id="get__workspace_workspaceid-responseschema"></a>

Status Code **200**

| Name          | Type    | Required | Restrictions | Description                                       |
| ------------- | ------- | -------- | ------------ | ------------------------------------------------- |
| » success     | boolean | true     | none         | Operation success status                          |
| » workspace   | object  | true     | none         | Workspace details                                 |
| »» id         | string  | true     | none         | Unique workspace identifier                       |
| »» name       | string  | true     | none         | Workspace name                                    |
| »» orgId      | string  | true     | none         | Organization identifier                           |
| »» users      | array   | true     | none         | Array of users with access to the workspace       |
| »»» userId    | string  | true     | none         | User identifier                                   |
| »»» role      | string  | true     | none         | User's role in the workspace (READ, WRITE, ADMIN) |
| »»» user      | object  | true     | none         | User details                                      |
| »»»» id       | string  | true     | none         | User identifier                                   |
| »»»» name     | string  | true     | none         | User's first name                                 |
| »»»» lastName | string  | true     | none         | User's last name                                  |
| »»»» email    | string  | true     | none         | User's email address                              |
| »»»» orgRole  | integer | false    | none         | User's organization role                          |

Status Code **404**

| Name      | Type    | Required | Restrictions | Description              |
| --------- | ------- | -------- | ------------ | ------------------------ |
| » success | boolean | true     | none         | Operation success status |
| » message | string  | true     | none         | Error message            |

Status Code **500**

| Name      | Type    | Required | Restrictions | Description              |
| --------- | ------- | -------- | ------------ | ------------------------ |
| » success | boolean | true     | none         | Operation success status |
| » message | string  | true     | none         | Error message            |

## Notes

* **Authentication Required**: User must be authenticated with a valid Bearer token
* **Access Control**: User must have access to the workspace (READ, WRITE, or ADMIN role)
* **User Details**: Includes detailed information about all users with access to the workspace
* **Role Information**: Shows the specific role each user has within the workspace
* **Organization Scoped**: Workspaces are scoped to the user's organization
* **Error Handling**: Returns 404 if the workspace doesn't exist or if the user doesn't have access


---

# 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.flashback.tech/support-reference/platform-api-reference/workspace/get__workspace_-workspaceid.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.
