# Students

## Obtém todos os alunos

> Este endpoint retorna todos os alunos cadastrados na plataforma, independentemente de possuírem uma assinatura ativa ou não. Por padrão, as assinaturas não são carregadas. Para incluí-las na resposta, utilize o parâmetro \`with=subscriptions\` na query string, permitindo o carregamento das assinaturas de cada aluno.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Student":{"type":"object","required":["id","first_name","full_name","email","document","reference_id","created_at","updated_at"],"properties":{"id":{"type":"string","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo"},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto do aluno"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone do aluno"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero do aluno"},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento do aluno YYY-MM-DD"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação do aluno","readOnly":true},"updated_at":{"type":"string","description":"Data de atualização do aluno","readOnly":true},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Public.StudentSubscription"},"description":"Assinaturas do aluno","readOnly":true}}},"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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":{"/students":{"get":{"operationId":"Students_read","summary":"Obtém todos os alunos","description":"Este endpoint retorna todos os alunos cadastrados na plataforma, independentemente de possuírem uma assinatura ativa ou não. Por padrão, as assinaturas não são carregadas. Para incluí-las na resposta, utilize o parâmetro `with=subscriptions` na query string, permitindo o carregamento das assinaturas de cada aluno.","parameters":[{"name":"with","in":"query","required":false,"description":"Permite incluir as assinaturas. Ex: with=subscriptions. Caso não seja informado, as assinaturas não serão carregadas.","schema":{"type":"string"},"explode":false}],"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/Public.Student"}},"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":["Students"]}}}}
```

## Criar novo aluno

> Este endpoint realiza apenas o cadastro do aluno, não criando nenhuma assinatura. A assinatura deve ser criada posteriormente, por meio do endpoint específico de criação de assinaturas, utilizando o ID do aluno previamente cadastrado.\
> \
> Caso seja informado um e-mail já existente, será lançado uma exception \`StudentAlreadyExistsException\`.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.StudentCreate":{"type":"object","required":["id","first_name","full_name","email","created_at","updated_at"],"properties":{"id":{"type":"string","description":"ID do aluno","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo","readOnly":true},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto","readOnly":true},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero","readOnly":true},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Exceptions.Validation":{"type":"object","required":["message","type","rules"],"properties":{"message":{"type":"string","default":"Erro de Validação, por favor revise os dados e tente novamente."},"type":{"type":"string","default":"ValidationException"},"rules":{"$ref":"#/components/schemas/Exceptions.Rules"}},"description":""},"Exceptions.Rules":{"type":"object","required":["field"],"properties":{"field":{"type":"array","items":{"type":"string"},"default":["Mensagem de validação"]}}},"Exceptions.Metadata":{"type":"object"},"Exceptions.StudentAlreadyExistsException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"The student with the email address [%] is already registered."},"type":{"type":"string","default":"StudentAlreadyExistsException"}},"description":""},"Exceptions.Unauthorized":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Personal access token not found."},"type":{"type":"string","default":"PersonalAccessTokenException"}},"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":{"/students":{"post":{"operationId":"Students_create","summary":"Criar novo aluno","description":"Este endpoint realiza apenas o cadastro do aluno, não criando nenhuma assinatura. A assinatura deve ser criada posteriormente, por meio do endpoint específico de criação de assinaturas, utilizando o ID do aluno previamente cadastrado.\n\nCaso seja informado um e-mail já existente, será lançado uma exception `StudentAlreadyExistsException`.","parameters":[],"responses":{"201":{"description":"The request has succeeded and a new resource has been created as a result.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Public.StudentCreate"}},"description":""}}}},"400":{"description":"The server could not understand the request due to invalid syntax.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.Validation"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.StudentAlreadyExistsException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}]}}}},"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":["Students"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public.StudentCreate"}}}}}}}}
```

## Obtem aluno por document

> Este endpoint retorna um aluno pelo seu document, desde que esteja cadastrado na plataforma, independentemente de possuir ou não uma assinatura ativa.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Student":{"type":"object","required":["id","first_name","full_name","email","document","reference_id","created_at","updated_at"],"properties":{"id":{"type":"string","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo"},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto do aluno"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone do aluno"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero do aluno"},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento do aluno YYY-MM-DD"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação do aluno","readOnly":true},"updated_at":{"type":"string","description":"Data de atualização do aluno","readOnly":true},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Public.StudentSubscription"},"description":"Assinaturas do aluno","readOnly":true}}},"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/document/{document}":{"get":{"operationId":"Students_getByDocument","summary":"Obtem aluno por document","description":"Este endpoint retorna um aluno pelo seu document, desde que esteja cadastrado na plataforma, independentemente de possuir ou não uma assinatura ativa.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.","parameters":[{"name":"document","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/Public.Student"}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Obtém aluno por e-mail

> Este endpoint retorna um aluno com base em seu e-mail, desde que esteja cadastrado na plataforma, independentemente de possuir uma assinatura ativa ou não. Neste caso, as assinaturas são sempre carregadas na resposta.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \`StudentNotFoundException\`.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Student":{"type":"object","required":["id","first_name","full_name","email","document","reference_id","created_at","updated_at"],"properties":{"id":{"type":"string","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo"},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto do aluno"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone do aluno"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero do aluno"},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento do aluno YYY-MM-DD"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação do aluno","readOnly":true},"updated_at":{"type":"string","description":"Data de atualização do aluno","readOnly":true},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Public.StudentSubscription"},"description":"Assinaturas do aluno","readOnly":true}}},"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/email/{email}":{"get":{"operationId":"Students_getByEmail","summary":"Obtém aluno por e-mail","description":"Este endpoint retorna um aluno com base em seu e-mail, desde que esteja cadastrado na plataforma, independentemente de possuir uma assinatura ativa ou não. Neste caso, as assinaturas são sempre carregadas na resposta.\n\nCaso o aluno não seja encontrado, será lançada a exceção `StudentNotFoundException`.","parameters":[{"name":"email","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/Public.Student"}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Criar link mágico por email

> Este endpoint gera um link mágico utilizando o próprio e-mail do aluno.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.MagicLink":{"type":"object","required":["expire_in","url"],"properties":{"expire_in":{"type":"integer","description":"Tempo de expiração em segundos","default":5},"url":{"type":"string","description":"Link mágico para acesso à plataforma","readOnly":true}}},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/email/{email}/magic-link":{"post":{"operationId":"Students_createMagicLink","summary":"Criar link mágico por email","description":"Este endpoint gera um link mágico utilizando o próprio e-mail do aluno.","parameters":[{"name":"email","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/Public.MagicLink"}},"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.StudentNotFoundException"},"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":["Students"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public.MagicLink"}}}}}}}}
```

## Obtem aluno por reference\_id

> Este endpoint retorna um aluno pelo seu reference\_id, desde que esteja cadastrado na plataforma, independentemente de possuir ou não uma assinatura ativa.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Student":{"type":"object","required":["id","first_name","full_name","email","document","reference_id","created_at","updated_at"],"properties":{"id":{"type":"string","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo"},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto do aluno"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone do aluno"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero do aluno"},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento do aluno YYY-MM-DD"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação do aluno","readOnly":true},"updated_at":{"type":"string","description":"Data de atualização do aluno","readOnly":true},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Public.StudentSubscription"},"description":"Assinaturas do aluno","readOnly":true}}},"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/reference/{reference_id}":{"get":{"operationId":"Students_getByReferenceId","summary":"Obtem aluno por reference_id","description":"Este endpoint retorna um aluno pelo seu reference_id, desde que esteja cadastrado na plataforma, independentemente de possuir ou não uma assinatura ativa.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.","parameters":[{"name":"reference_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/Public.Student"}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Obtém aluno por ID

> Este endpoint retorna um aluno com base em seu ID, desde que esteja cadastrado na plataforma, independentemente de possuir uma assinatura ativa ou não. Neste caso, as assinaturas são sempre carregadas na resposta.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \`StudentNotFoundException\`.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Student":{"type":"object","required":["id","first_name","full_name","email","document","reference_id","created_at","updated_at"],"properties":{"id":{"type":"string","readOnly":true},"first_name":{"type":"string","description":"Nome"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sobrenome"},"full_name":{"type":"string","description":"Nome completo"},"email":{"type":"string","description":"E-mail"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL da foto do aluno"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Telefone do aluno"},"genre":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gênero do aluno"},"birth":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de nascimento do aluno YYY-MM-DD"},"document":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Documento do aluno"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Identificador externo do aluno (Usado para integrações externas)"},"created_at":{"type":"string","description":"Data de criação do aluno","readOnly":true},"updated_at":{"type":"string","description":"Data de atualização do aluno","readOnly":true},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Public.StudentSubscription"},"description":"Assinaturas do aluno","readOnly":true}}},"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}":{"get":{"operationId":"Students_get","summary":"Obtém aluno por ID","description":"Este endpoint retorna um aluno com base em seu ID, desde que esteja cadastrado na plataforma, independentemente de possuir uma assinatura ativa ou não. Neste caso, as assinaturas são sempre carregadas na resposta.\n\nCaso o aluno não seja encontrado, será lançada a exceção `StudentNotFoundException`.","parameters":[{"name":"student_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/Public.Student"}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Excluir o cadastro de aluno

> Este endpoint realiza a exclusão de um aluno na plataforma. Caso o aluno possua assinaturas, elas também serão excluídas.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}":{"delete":{"operationId":"Students_deleteUser","summary":"Excluir o cadastro de aluno","description":"Este endpoint realiza a exclusão de um aluno na plataforma. Caso o aluno possua assinaturas, elas também serão excluídas.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"There is no content to send for this request, but the headers may be useful. "},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Criar link mágico por ID

> Este endpoint gera um link mágico utilizando o próprio ID do aluno.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.MagicLink":{"type":"object","required":["expire_in","url"],"properties":{"expire_in":{"type":"integer","description":"Tempo de expiração em segundos","default":5},"url":{"type":"string","description":"Link mágico para acesso à plataforma","readOnly":true}}},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}/magic-link":{"post":{"operationId":"Students_createMagicLinkById","summary":"Criar link mágico por ID","description":"Este endpoint gera um link mágico utilizando o próprio ID do aluno.","parameters":[{"name":"student_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/Public.MagicLink"}},"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.StudentNotFoundException"},"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":["Students"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public.MagicLink"}}}}}}}}
```

## Obtém todos os produtos relacionados a um aluno (Assinaturas).

> Este endpoint retorna todos os produtos \*\*(Assinataruas)\*\* relacionados a um aluno pelo seu ID.\
> \
> Caso o aluno não possua nenhum produto \*\*(Assinatura)\*\*, será retornada uma lista vazia.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}/products":{"get":{"operationId":"Students_getSubscription","summary":"Obtém todos os produtos relacionados a um aluno (Assinaturas).","description":"Este endpoint retorna todos os produtos **(Assinataruas)** relacionados a um aluno pelo seu ID.\n\nCaso o aluno não possua nenhum produto **(Assinatura)**, será retornada uma lista vazia.","parameters":[{"name":"student_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/Public.StudentSubscription"}}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Criar uma assinatura

> Este endpoint cria uma assinatura para um aluno.\
> \
> Caso seja informado um ID de aluno inexistente, será lançada a exceção \`StudentNotFoundException\`.\
> \
> Caso seja informado um ID de produto inexistente, será lançada a exceção \`ProductNotFoundException\`.\
> \
> Caso o aluno já possua essa assinatura, será lançada a exceção \`SubscriptionAlreadyExistsException\`.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"Exceptions.Validation":{"type":"object","required":["message","type","rules"],"properties":{"message":{"type":"string","default":"Erro de Validação, por favor revise os dados e tente novamente."},"type":{"type":"string","default":"ValidationException"},"rules":{"$ref":"#/components/schemas/Exceptions.Rules"}},"description":""},"Exceptions.Rules":{"type":"object","required":["field"],"properties":{"field":{"type":"array","items":{"type":"string"},"default":["Mensagem de validação"]}}},"Exceptions.Metadata":{"type":"object"},"Exceptions.SubscriptionAlreadyExistsException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] already has a subscription for this product"},"type":{"type":"string","default":"SubscriptionAlreadyExistsException"}},"description":""},"Exceptions.Unauthorized":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Personal access token not found."},"type":{"type":"string","default":"PersonalAccessTokenException"}},"description":""},"Exceptions.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"description":""},"Exceptions.ProductNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Product [%] not found."},"type":{"type":"string","default":"ProductNotFoundException"}},"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":""},"Public.SubscriptionCreate":{"type":"object","required":["product_id","accession_date","expiration_date"],"properties":{"product_id":{"type":"string","description":"ID do produto"},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"}}}}},"paths":{"/students/{student_id}/products":{"post":{"operationId":"Students_createSubscription","summary":"Criar uma assinatura","description":"Este endpoint cria uma assinatura para um aluno.\n\nCaso seja informado um ID de aluno inexistente, será lançada a exceção `StudentNotFoundException`.\n\nCaso seja informado um ID de produto inexistente, será lançada a exceção `ProductNotFoundException`.\n\nCaso o aluno já possua essa assinatura, será lançada a exceção `SubscriptionAlreadyExistsException`.","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The request has succeeded and a new resource has been created as a result.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Public.StudentSubscription"}},"description":""}}}},"400":{"description":"The server could not understand the request due to invalid syntax.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.Validation"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.SubscriptionAlreadyExistsException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}}]}}}},"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":{"anyOf":[{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.StudentNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.ProductNotFoundException"},"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":["Students"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public.SubscriptionCreate"}}}}}}}}
```

## Obtém um produto de um aluno por ID (Assinatura)

> Este endpoint retorna um produto \*\*(Assinatura)\*\* específico de um aluno.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.\
> \
> Caso o produto não seja encontrado, será lançada a exceção \*\*ProductNotFoundException\*\*\
> \
> Caso o produto/aluno informado não corresponda a uma assinatura, será lançada a exceção \*\*SubscriptionNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.StudentSubscription":{"type":"object","required":["active","status","product_id","payment_last_date","accession_date","expiration_date","product","created_at","updated_at"],"properties":{"active":{"type":"integer","description":"Indica se o aluno esta com acesso ativo","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/Public.SubscriptionStatus"}],"description":"Status da assinatura (active, inactive, refunded, chargeback e cancel)","readOnly":true},"product_id":{"type":"string","description":"ID do produto"},"payment_last_date":{"type":"string","description":"Data do último pagamento YYYY-MM-DD","readOnly":true},"accession_date":{"type":"string","description":"Data de adesão YYYY-MM-DD"},"expiration_date":{"type":"string","description":"Data de expiração YYYY-MM-DD"},"cancel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Data de cancelamento YYYY-MM-DD","readOnly":true},"product":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"],"description":"Produto da assinatura","readOnly":true},"created_at":{"type":"string","description":"Data de criação","readOnly":true},"updated_at":{"type":"string","description":"Data da última atualização","readOnly":true}}},"Public.SubscriptionStatus":{"type":"string","enum":["active","inactive","refunded","cancel","chargeback"]},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"description":""},"Exceptions.ProductNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Product [%] not found."},"type":{"type":"string","default":"ProductNotFoundException"}},"description":""},"Exceptions.SubscriptionNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Subscription [%] not found."},"type":{"type":"string","default":"SubscriptiontNotFoundException"}},"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":{"/students/{student_id}/products/{product_id}":{"get":{"operationId":"Students_getSubscriptionById","summary":"Obtém um produto de um aluno por ID (Assinatura)","description":"Este endpoint retorna um produto **(Assinatura)** específico de um aluno.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.\n\nCaso o produto não seja encontrado, será lançada a exceção **ProductNotFoundException**\n\nCaso o produto/aluno informado não corresponda a uma assinatura, será lançada a exceção **SubscriptionNotFoundException**.","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"product_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/Public.StudentSubscription"}},"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":{"anyOf":[{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.StudentNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.ProductNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.SubscriptionNotFoundException"},"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":["Students"]}}}}
```

## Excluír o produto de um aluno (Assinatura)

> Este endpoint realiza a exclusão de uma assinatura de um aluno.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.\
> \
> Caso a produto não seja encontrado, será lançada a exceção \*\*ProductNotFoundException\*\*.\
> \
> Caso o produto/aluno informado não corresponda a uma assinatura, será lançada a exceção \*\*SubscriptionNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"description":""},"Exceptions.ProductNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Product [%] not found."},"type":{"type":"string","default":"ProductNotFoundException"}},"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":{"/students/{student_id}/products/{product_id}":{"delete":{"operationId":"Students_deleteSubscriptionById","summary":"Excluír o produto de um aluno (Assinatura)","description":"Este endpoint realiza a exclusão de uma assinatura de um aluno.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.\n\nCaso a produto não seja encontrado, será lançada a exceção **ProductNotFoundException**.\n\nCaso o produto/aluno informado não corresponda a uma assinatura, será lançada a exceção **SubscriptionNotFoundException**.","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"There is no content to send for this request, but the headers may be useful. "},"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":{"anyOf":[{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.StudentNotFoundException"},"trace_id":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Exceptions.Metadata"}}},{"type":"object","required":["error","trace_id","metadata"],"properties":{"error":{"$ref":"#/components/schemas/Exceptions.ProductNotFoundException"},"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":["Students"]}}}}
```

## Obtém as pontuações de um aluno.

> Este endpoint retorna as pontuações de um aluno.\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Score":{"type":"object","required":["score","posts","comments","replies"],"properties":{"score":{"type":"integer","description":"Valor da pontuação","default":0},"posts":{"type":"integer","default":0,"readOnly":true},"comments":{"type":"integer","default":0,"readOnly":true},"replies":{"type":"integer","default":0,"readOnly":true}}},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}/scores":{"get":{"operationId":"Students_getScore","summary":"Obtém as pontuações de um aluno.","description":"Este endpoint retorna as pontuações de um aluno.\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.","parameters":[{"name":"student_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/Public.Score"}},"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.StudentNotFoundException"},"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":["Students"]}}}}
```

## Atualiza as pontuações de um aluno.

> Este endpoint atualiza as pontuações do aluno\
> \
> Caso o aluno não seja encontrado, será lançada a exceção \*\*StudentNotFoundException\*\*.

```json
{"openapi":"3.1.0","info":{"title":"TheMembers (Beta).","version":"1.0"},"tags":[{"name":"Students"}],"servers":[{"url":"https://api.themembers.com.br/api/v1","description":"Production","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Public.Score":{"type":"object","required":["score","posts","comments","replies"],"properties":{"score":{"type":"integer","description":"Valor da pontuação","default":0},"posts":{"type":"integer","default":0,"readOnly":true},"comments":{"type":"integer","default":0,"readOnly":true},"replies":{"type":"integer","default":0,"readOnly":true}}},"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.StudentNotFoundException":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","default":"Student [%] not found."},"type":{"type":"string","default":"StudentNotFoundException"}},"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":{"/students/{student_id}/scores":{"put":{"operationId":"Students_updateScore","summary":"Atualiza as pontuações de um aluno.","description":"Este endpoint atualiza as pontuações do aluno\n\nCaso o aluno não seja encontrado, será lançada a exceção **StudentNotFoundException**.","parameters":[{"name":"student_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/Public.Score"}},"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.StudentNotFoundException"},"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":["Students"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Public.Score"}}}}}}}}
```


---

# 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://documentation.themembers.dev.br/api-reference/reference/students.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.
