openapi: 3.1.0 info: title: Medium OAuth2 Authorization Users API description: The Medium OAuth2 API enables third-party applications to authenticate and authorize users to act on their behalf on the Medium platform. Applications redirect users to Medium's authorization endpoint to obtain an authorization code, which is then exchanged for an access token and refresh token. The OAuth2 flow supports scoped permissions including basicProfile, publishPost, listPublications, and uploadImage, allowing developers to request only the level of access their application requires. Access tokens are valid for 60 days and can be refreshed using refresh tokens. version: '1.0' contact: name: Medium Support url: https://help.medium.com termsOfService: https://policy.medium.com/medium-terms-of-service-9db0094a1e0f servers: - url: https://medium.com/m/oauth description: OAuth2 Authorization Server - url: https://api.medium.com/v1 description: Token Exchange Endpoint tags: - name: Users description: Operations for retrieving authenticated user profile information including username, name, URL, and avatar image. paths: /me: get: operationId: getAuthenticatedUser summary: Get authenticated user description: Returns details of the authenticated user including their unique user ID, username, display name, profile URL, and avatar image URL. This endpoint is typically used after authentication to obtain the user ID required by other endpoints. tags: - Users responses: '200': description: Successfully retrieved the authenticated user profile. content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/User' '401': description: The access token is invalid, has been revoked, or was not provided. content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: User: type: object description: A Medium user profile containing identifying information and profile metadata. properties: id: type: string description: The unique identifier for the user on Medium. username: type: string description: The user's username on Medium, used in their profile URL. name: type: string description: The user's display name as shown on their profile. url: type: string format: uri description: The URL to the user's Medium profile page. imageUrl: type: string format: uri description: The URL to the user's avatar image on Medium. Error: type: object description: An error response from the Medium API containing error details. properties: errors: type: array items: type: object properties: message: type: string description: A human-readable description of the error. code: type: integer description: The numeric error code identifying the error type. externalDocs: description: Medium API Authentication Documentation url: https://github.com/Medium/medium-api-docs#2-authentication