> For the complete documentation index, see [llms.txt](https://documentation.themembers.dev.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.themembers.dev.br/api-reference/reference/courses.md).

# Courses

## Obtém todos os cursos da plataforma

> Este endpoint retorna todos os cursos cadastrados na plataforma, independentemente do status. Caso não haja nenhum curso cadastrado, será retornada uma lista vazia.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Courses"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Course":{"type":"object","required":["id","title","description","status","slug","blocked","published","url_upsell","text_upsell","modules"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"integer"},"published":{"type":"integer"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/Module"}}}},"Module":{"type":"object","required":["id","title","description","slug","blocked","published","url_upsell","text_upsell","lessons"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"string"},"published":{"type":"string"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"},"lessons":{"type":"array","items":{"$ref":"#/components/schemas/Lesson"}}}},"Lesson":{"type":"object","required":["id","title","subtitle","slug","blocked","published","url_upsell","text_upsell"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"string"},"published":{"type":"string"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"}}},"Public.Link":{"type":"object","properties":{"first":{"type":"string"},"last":{"type":"string"},"prev":{"type":"string"},"next":{"type":"string"}}},"Public.Meta":{"type":"object","properties":{"first":{"type":"string"},"last":{"type":"string"},"prev":{"type":"string"},"next":{"type":"string"}}},"Exceptions.Unauthorized":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Personal access token not found."},"type":{"type":"string","default":"PersonalAccessTokenException"}},"description":""},"Exceptions.Metadata":{"type":"object"},"Exceptions.RateLimitException":{"type":"object","required":["message","type","retry_after"],"properties":{"message":{"type":"string","default":"Rate limit exceeded for API key [%]"},"type":{"type":"string","default":"RateLimitException"},"retry_after":{"type":"integer"}},"description":""},"Exceptions.InternalServerError":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"An unexpected error occurred. Please try again later."},"type":{"type":"string","default":"InternalServerErrorException"}},"description":""}}},"paths":{"/courses":{"get":{"operationId":"Courses_getCourse","summary":"Obtém todos os cursos da plataforma","description":"Este endpoint retorna todos os cursos cadastrados na plataforma, independentemente do status. Caso não haja nenhum curso cadastrado, será retornada uma lista vazia.","parameters":[],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data","links","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Course"}},"links":{"$ref":"#/components/schemas/Public.Link"},"meta":{"$ref":"#/components/schemas/Public.Meta"}},"description":""}}}},"401":{"description":"Access is unauthorized.","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.Unauthorized"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"429":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.RateLimitException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.InternalServerError"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}}},"tags":["Courses"]}}}}
```

## Obtém um curso por ID

> Este endpoint retorna um curso por ID cadastrado na plataforma, independentemente do status.\
> \
> Caso o curso não seja encontrado, uma exception \*\*CourseNotFoundException\*\* será lançada.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Courses"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Course":{"type":"object","required":["id","title","description","status","slug","blocked","published","url_upsell","text_upsell","modules"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"integer"},"published":{"type":"integer"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/Module"}}}},"Module":{"type":"object","required":["id","title","description","slug","blocked","published","url_upsell","text_upsell","lessons"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"string"},"published":{"type":"string"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"},"lessons":{"type":"array","items":{"$ref":"#/components/schemas/Lesson"}}}},"Lesson":{"type":"object","required":["id","title","subtitle","slug","blocked","published","url_upsell","text_upsell"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"slug":{"type":"string"},"blocked":{"type":"string"},"published":{"type":"string"},"url_upsell":{"type":"string"},"text_upsell":{"type":"string"}}},"Exceptions.Unauthorized":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Personal access token not found."},"type":{"type":"string","default":"PersonalAccessTokenException"}},"description":""},"Exceptions.Metadata":{"type":"object"},"Exceptions.CourseNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Course [%] not found."},"type":{"type":"string","default":"CourseNotFoundException"}},"description":""},"Exceptions.RateLimitException":{"type":"object","required":["message","type","retry_after"],"properties":{"message":{"type":"string","default":"Rate limit exceeded for API key [%]"},"type":{"type":"string","default":"RateLimitException"},"retry_after":{"type":"integer"}},"description":""},"Exceptions.InternalServerError":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"An unexpected error occurred. Please try again later."},"type":{"type":"string","default":"InternalServerErrorException"}},"description":""}}},"paths":{"/courses/{course_id}":{"get":{"operationId":"Courses_getCourseById","summary":"Obtém um curso por ID","description":"Este endpoint retorna um curso por ID cadastrado na plataforma, independentemente do status.\n\nCaso o curso não seja encontrado, uma exception **CourseNotFoundException** será lançada.","parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Course"}},"description":""}}}},"401":{"description":"Access is unauthorized.","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.Unauthorized"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.CourseNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"429":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.RateLimitException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.InternalServerError"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}}},"tags":["Courses"]}}}}
```

## Obtém historico de acesso a um curso

> Este endpoint retorna uma lista com o histórico de acesso de cada aluno em um curso específico. \
> Com essas informações, é possível identificar se o aluno já concluiu o curso e em qual data ocorreu a conclusão,\
> além de verificar o último acesso realizado nesse curso.\
> \
> Caso o course\_id informado não seja encontrado, será lançada a exception \*\*CourseNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Courses"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"CourseAccessHistoryByStudent":{"type":"object","required":["id","name","email","course"],"properties":{"id":{"type":"string","description":"ID do aluno"},"name":{"type":"string","description":"Nome do aluno"},"email":{"type":"string","description":"E-mail do aluno"},"course":{"type":"object","properties":{"id":{"type":"string","description":"ID do curso"},"name":{"type":"string","description":"Nome do curso"},"last_access_at":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data da última acesso YYYY-MM-DD"},"finished":{"type":"integer","description":"Indica se o curso foi finalizado 0 ou 1"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de finalização YYYY-MM-DD"}},"required":["id","name","finished"],"description":"Curso"}}},"Exceptions.Unauthorized":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Personal access token not found."},"type":{"type":"string","default":"PersonalAccessTokenException"}},"description":""},"Exceptions.Metadata":{"type":"object"},"Exceptions.CourseNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Course [%] not found."},"type":{"type":"string","default":"CourseNotFoundException"}},"description":""},"Exceptions.RateLimitException":{"type":"object","required":["message","type","retry_after"],"properties":{"message":{"type":"string","default":"Rate limit exceeded for API key [%]"},"type":{"type":"string","default":"RateLimitException"},"retry_after":{"type":"integer"}},"description":""},"Exceptions.InternalServerError":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"An unexpected error occurred. Please try again later."},"type":{"type":"string","default":"InternalServerErrorException"}},"description":""}}},"paths":{"/courses/{course_id}/accesses":{"get":{"operationId":"Courses_getCourseAccessHistory","summary":"Obtém historico de acesso a um curso","description":"Este endpoint retorna uma lista com o histórico de acesso de cada aluno em um curso específico. \nCom essas informações, é possível identificar se o aluno já concluiu o curso e em qual data ocorreu a conclusão,\nalém de verificar o último acesso realizado nesse curso.\n\nCaso o course_id informado não seja encontrado, será lançada a exception **CourseNotFoundException**.","parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CourseAccessHistoryByStudent"}}},"description":""}}}},"401":{"description":"Access is unauthorized.","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.Unauthorized"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.CourseNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"429":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.RateLimitException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.InternalServerError"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}}}}},"tags":["Courses"]}}}}
```
