# Responses

## Get application responses

> Retrieves a paginated list of responses for a specific application.

```json
{"openapi":"3.0.3","info":{"title":"BloxTech Developer API","version":"1.0.0"},"servers":[{"url":"https://bloxtech.tech/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key"}},"schemas":{"Response":{"type":"object","properties":{"id":{"type":"integer"},"applicationid":{"type":"integer"},"state":{"type":"string","enum":["new","passed","failed","processing"]},"responsejson":{"type":"object","description":"JSON object containing the actual response data","nullable":true}}},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"perPage":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"},"hasMore":{"type":"boolean"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}},"responses":{"Unauthorized":{"description":"Unauthorized (Missing or invalid API key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Access denied to the requested resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/applications/{app_id}/responses":{"get":{"tags":["Responses"],"summary":"Get application responses","description":"Retrieves a paginated list of responses for a specific application.","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"integer"},"description":"The ID of the application"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"minimum":1},"description":"Page number for pagination"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"minimum":10,"maximum":50},"description":"The number of responses to return per page"},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["new","processing","passed","failed"]},"description":"Filter responses by their current state"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Response"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"filters":{"type":"object","properties":{"state":{"type":"string","nullable":true}}}}}}}},"400":{"description":"Bad request (Invalid limit or state)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## Update a response state

> Updates the state of a specific response.

```json
{"openapi":"3.0.3","info":{"title":"BloxTech Developer API","version":"1.0.0"},"servers":[{"url":"https://bloxtech.tech/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}},"responses":{"Unauthorized":{"description":"Unauthorized (Missing or invalid API key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Access denied to the requested resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/responses/{id}":{"patch":{"tags":["Responses"],"summary":"Update a response state","description":"Updates the state of a specific response.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"The ID of the response to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["state"],"properties":{"state":{"type":"string","enum":["passed","failed","processing"],"description":"The new state for the response"}}}}}},"responses":{"200":{"description":"State updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"state":{"type":"string"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request (Invalid JSON or missing/invalid state)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```
