# Competitions

Endpoints for managing competitions

## Get competition by ID

> Retrieves competition details by its ID. Requires access to the competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}":{"get":{"tags":["Competitions"],"summary":"Get competition by ID","description":"Retrieves competition details by its ID. Requires access to the competition.","operationId":"getById","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompetitionDto"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## PUT /api/competitions/{compId}

>

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionEditDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","name","public","showInput","showOutput","showRating"]},"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}":{"put":{"tags":["Competitions"],"operationId":"update","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitionEditDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompetitionDto"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## \[ADMIN] Get competition users

> Retrieves the list of users participating in a specific competition. Required admin role.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the user"},"username":{"type":"string","description":"Username of the user"}},"required":["id","username"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/users":{"get":{"tags":["Competitions"],"summary":"[ADMIN] Get competition users","description":"Retrieves the list of users participating in a specific competition. Required admin role.","operationId":"getUsers","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## \[ADMIN] Edit competition users

> Updates the list of users participating in a specific competition. Required admin role.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EditUsersRequest":{"type":"object","description":"Request to edit users","properties":{"usersIds":{"type":"array","description":"Set of user IDs to be edited","items":{"type":"integer","format":"int64"},"uniqueItems":true}},"required":["usersIds"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/users":{"put":{"tags":["Competitions"],"summary":"[ADMIN] Edit competition users","description":"Updates the list of users participating in a specific competition. Required admin role.","operationId":"editUsers","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditUsersRequest"}}},"required":true},"responses":{"202":{"description":"Accepted"},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## \[ADMIN] Edit competition checkers

> Updates the list of checkers for a specific competition. Required admin role.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EditUsersRequest":{"type":"object","description":"Request to edit users","properties":{"usersIds":{"type":"array","description":"Set of user IDs to be edited","items":{"type":"integer","format":"int64"},"uniqueItems":true}},"required":["usersIds"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/checkers":{"put":{"tags":["Competitions"],"summary":"[ADMIN] Edit competition checkers","description":"Updates the list of checkers for a specific competition. Required admin role.","operationId":"editCheckers","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditUsersRequest"}}},"required":true},"responses":{"202":{"description":"Accepted"},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## \[ADMIN] Get all competitions

> Retrieves a list of all competitions. Required admin role.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions":{"get":{"tags":["Competitions"],"summary":"[ADMIN] Get all competitions","description":"Retrieves a list of all competitions. Required admin role.","operationId":"getAll_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitionDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## \[ADMIN] Create a new competition

> Creates a new competition object. Required admin role.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionCreateDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"}},"required":["description","name"]},"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions":{"post":{"tags":["Competitions"],"summary":"[ADMIN] Create a new competition","description":"Creates a new competition object. Required admin role.","operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitionCreateDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompetitionDto"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Submit an answer

> Allows a user to submit an answer for a specific competition problem.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SendAnswerRequest":{"type":"object","description":"Request to send an answer","properties":{"checker":{"type":"integer","format":"int64","description":"ID of the checker"},"src":{"type":"string","description":"Source code submitted as the answer"},"id":{"type":"integer","format":"int64","description":"ID of the answer"}},"required":["checker","id","src"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/send":{"post":{"tags":["Competitions"],"summary":"Submit an answer","description":"Allows a user to submit an answer for a specific competition problem.","operationId":"send","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendAnswerRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Join to public competition problem by ID

> Every user can join to public competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/publicJoin":{"post":{"tags":["Competitions"],"summary":"Join to public competition problem by ID","description":"Every user can join to public competition.","operationId":"joinToPublicCompetition","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get all answers

> Retrieves all answers submitted by the authenticated user for a specific competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AnswerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the answer"},"user":{"$ref":"#/components/schemas/UserDto","description":"User who submitted the answer"},"status":{"type":"string","description":"Current status of the answer","enum":["IN_PROGRESS","COMPLETED"]},"score":{"type":"integer","format":"int32","description":"Score awarded for the answer"},"code":{"type":"string","description":"Code submitted by the user"},"result":{"type":"string","description":"Result of the code execution"},"checker":{"$ref":"#/components/schemas/CheckerDto","description":"Checker used to evaluate the answer"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the answer was created"},"competitionsProblems":{"$ref":"#/components/schemas/CompetitionsProblemsDto","description":"Details of the competition problem associated with the answer"}},"required":["checker","code","createdAt","status","user"]},"UserDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the user"},"username":{"type":"string","description":"Username of the user"}},"required":["id","username"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"CompetitionsProblemsDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition problem"},"priority":{"type":"integer","format":"int32","description":"Priority of problem for sorting"},"problem":{"$ref":"#/components/schemas/ProblemDto","description":"Unique identifier of the competition problem"},"slug":{"type":"string","description":"Unique identifier of the competition problem"}},"required":["id","priority","problem","slug"]},"ProblemDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the problem"},"name":{"type":"string","description":"Name of the problem"},"description":{"type":"string","description":"Description of the problem"},"inData":{"type":"string","description":"Input data for the problem"},"outData":{"type":"string","description":"Expected output data for the problem"},"public":{"type":"boolean","description":"Indicates if the problem is public"}},"required":["description","examples","id","inData","name","outData"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/sends":{"get":{"tags":["Competitions"],"summary":"Get all answers","description":"Retrieves all answers submitted by the authenticated user for a specific competition.","operationId":"getAnswers","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnswerDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get competition problems

> Retrieves all problems associated with a specific competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionsProblemsDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition problem"},"priority":{"type":"integer","format":"int32","description":"Priority of problem for sorting"},"problem":{"$ref":"#/components/schemas/ProblemDto","description":"Unique identifier of the competition problem"},"slug":{"type":"string","description":"Unique identifier of the competition problem"}},"required":["id","priority","problem","slug"]},"ProblemDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the problem"},"name":{"type":"string","description":"Name of the problem"},"description":{"type":"string","description":"Description of the problem"},"inData":{"type":"string","description":"Input data for the problem"},"outData":{"type":"string","description":"Expected output data for the problem"},"public":{"type":"boolean","description":"Indicates if the problem is public"}},"required":["description","examples","id","inData","name","outData"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/problems":{"get":{"tags":["Competitions"],"summary":"Get competition problems","description":"Retrieves all problems associated with a specific competition.","operationId":"getProblemsByCompetition","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitionsProblemsDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get competition problem by ID

> Retrieves a specific problem by its ID within a competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionsProblemsDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition problem"},"priority":{"type":"integer","format":"int32","description":"Priority of problem for sorting"},"problem":{"$ref":"#/components/schemas/ProblemDto","description":"Unique identifier of the competition problem"},"slug":{"type":"string","description":"Unique identifier of the competition problem"}},"required":["id","priority","problem","slug"]},"ProblemDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the problem"},"name":{"type":"string","description":"Name of the problem"},"description":{"type":"string","description":"Description of the problem"},"inData":{"type":"string","description":"Input data for the problem"},"outData":{"type":"string","description":"Expected output data for the problem"},"public":{"type":"boolean","description":"Indicates if the problem is public"}},"required":["description","examples","id","inData","name","outData"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/problems/{id}":{"get":{"tags":["Competitions"],"summary":"Get competition problem by ID","description":"Retrieves a specific problem by its ID within a competition.","operationId":"getProblemsByIdByCompetition","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompetitionsProblemsDto"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get competition leaderboard

> Retrieves the leaderboard for a specific competition.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Leaderboard":{"type":"object","properties":{"score":{"type":"array","items":{"$ref":"#/components/schemas/LeaderBoardScoreOrderQuery"}},"data":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/LeaderBoardAllTasksQuery"}}}},"required":["data","score"]},"LeaderBoardScoreOrderQuery":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"userX":{"type":"string"},"score":{"type":"integer","format":"int64"},"time":{"type":"string","format":"date-time"}},"required":["score","time","userId","userX"]},"LeaderBoardAllTasksQuery":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"competitionproblemId":{"type":"integer","format":"int64"},"maxScore":{"type":"integer","format":"int64"}},"required":["competitionproblemId","maxScore","userId"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/{compId}/leaderboard":{"get":{"tags":["Competitions"],"summary":"Get competition leaderboard","description":"Retrieves the leaderboard for a specific competition.","operationId":"leaderboard","parameters":[{"name":"compId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Leaderboard"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get all public competitions

> Retrieves a list of public competitions.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/public":{"get":{"tags":["Competitions"],"summary":"Get all public competitions","description":"Retrieves a list of public competitions.","operationId":"getPublic","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitionDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```

## Get competitions available for user

> Retrieves all competitions accessible to the authenticated user.

```json
{"openapi":"3.1.0","info":{"title":"Codebattles backend","version":"0.1.0"},"tags":[{"name":"Competitions","description":"Endpoints for managing competitions"}],"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"JWT":[]}],"components":{"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CompetitionDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the competition"},"checkers":{"type":"array","description":"Set of checkers associated with the competition","items":{"$ref":"#/components/schemas/CheckerDto"},"uniqueItems":true},"name":{"type":"string","description":"Name of the competition"},"description":{"type":"string","description":"Description of the competition"},"startedAt":{"type":"string","format":"date-time","description":"Start time of the competition"},"endedAt":{"type":"string","format":"date-time","description":"End time of the competition"},"public":{"type":"boolean","description":"If public everyone can join into competition"},"showInput":{"type":"boolean"},"showOutput":{"type":"boolean"},"showRating":{"type":"boolean"}},"required":["description","id","name","public","showInput","showOutput","showRating"]},"CheckerDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the checker"},"displayName":{"type":"string","description":"Display name of the checker"},"languageHighlightName":{"type":"string","description":"Programming language used by the checker"}},"required":["displayName","languageHighlightName"]},"UnauthorizedResponse":{"type":"object","description":"Response returned when the user is not authenticated.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"AccessDeniedResponse":{"type":"object","description":"Response returned when the user does not have permission to access the requested resource.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"ConflictResponse":{"type":"object","description":"Response returned when the conflict in data.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}},"InternalServerErrorResponse":{"type":"object","description":"Response returned when an unexpected error occurs on the server.","properties":{"message":{"type":"string","description":"Detailed message about the error."},"code":{"type":"integer","format":"int32","description":"HTTP status code representing the error."}}}}},"paths":{"/api/competitions/me":{"get":{"tags":["Competitions"],"summary":"Get competitions available for user","description":"Retrieves all competitions accessible to the authenticated user.","operationId":"getAllAvaliableForUser","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitionDto"}}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AccessDeniedResponse"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponse"}}}}}}}}}
```


---

# 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.codebattles.ru/api/backend/competitions.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.
