Get Organization
Method
REST method is adopted.
HTTP Method
GET: Get organization information
Naming Convention
To unify the naming of query parameters and nodes and improve readability, snake_case is used for URIs and JSON nodes in requests.
Request and Response
Headers
Meta information is set in HTTP headers, not in the response body.
Request Headers
AuthorizationContent-TypeAcceptAccept-language
Response Headers
Content-Type
Get Organization Information
URI
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| organization_id | string | Required | Organization UUID |
Response
The response is JSON.
{
"id": "org-uuid",
"name": "Acme Corporation",
"createdAt": 1234567890000,
"updatedAt": 1234567890000,
"createdBy": "creator-id",
"updatedBy": "updater-id",
"deletedAt": null,
"deletedBy": null
}
Response Fields
| Name | Type | Description |
|---|---|---|
| id | string | Organization UUID |
| name | string | Organization name |
| createdAt | number | Creation timestamp (epoch milliseconds) |
| updatedAt | number | Update timestamp (epoch milliseconds) |
| deletedAt | number | null | Deletion timestamp (epoch milliseconds) |
Authentication
Authentication is performed using JSON Web Tokens (JWT) issued by Amazon Cognito.
Error Handling
The status codes for error handling are as follows.
| Description | Status Code | Status Name |
|---|---|---|
| Missing credentials | 401 | Unauthorized |
| Insufficient permissions | 403 | Forbidden |
| Organization not found | 404 | Not Found |
| Internal server error | 500 | Internal Server Error |
Processing Flow
- Extract organization ID from path parameters
- Retrieve the requester's Cognito sub
- Perform admin/user access check in the service handler
- Query the organization from the database
- Verify the requester has access (member or admin)
- Return organization information
Detailed Flowchart
flowchart TD
Start([GET Request]) --> Auth[Auth & Parameter Extraction]
Auth --> Service[Service Layer]
Service --> AccessCheck[Access Check]
AccessCheck --> HasAccess{Read permission?}
HasAccess -->|No| Err404[404 Not Found]
HasAccess -->|Yes| QueryDB[Repository Layer]
QueryDB --> FindRecord[Fetch Record<br/>WHERE deletedAt IS NULL]
FindRecord --> Exists{Exists?}
Exists -->|No| Err404
Exists -->|Yes| Format[Format Response]
Format --> Success[200 OK]
Authorization
- Regular users can only access their own organization
- Administrator users can access all organizations