> ## Documentation Index
> Fetch the complete documentation index at: https://docs.member.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore Achievement

> Restore a previously revoked earn — the repair path for an accidental revoke.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/members/{contact_id}/achievements/{achievement_id}/restore
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/hubs/{hub_id}/members/{contact_id}/achievements/{achievement_id}/restore:
    post:
      tags:
        - achievements-admin
      summary: Restore Achievement
      description: >-
        Restore a previously revoked earn — the repair path for an accidental
        revoke.
      operationId: >-
        achievements_admin.post_achievements_admin_post_teams_by_team_id_hubs_by_hub_id_members_by_contact_id_achievements_by_achievement_id_restore
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
        - in: path
          name: contact_id
          required: true
          schema:
            title: Contact Id
            type: string
        - in: path
          name: achievement_id
          required: true
          schema:
            title: Achievement Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AchievementRestoreEnvelope'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: >-
                  #/components/schemas/JsonApiResponse_AchievementEarnAttributes_
          description: Successful Response
        '401':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not authenticated
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Forbidden
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Resource not found
        '415':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Unsupported media type (requires application/vnd.api+json)
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Unprocessable entity
      security:
        - HTTPBearer: []
components:
  schemas:
    AchievementRestoreEnvelope:
      description: Top-level JSON:API request envelope for restoring an achievement earn.
      properties:
        data:
          $ref: '#/components/schemas/AchievementRestoreData'
      required:
        - data
      title: AchievementRestoreEnvelope
      type: object
    JsonApiResponse_AchievementEarnAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_AchievementEarnAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[AchievementEarnAttributes]
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    AchievementRestoreData:
      description: JSON:API data envelope for restoring an achievement earn.
      properties:
        attributes:
          $ref: '#/components/schemas/AchievementRestoreAttributes'
        type:
          title: Type
          type: string
      required:
        - type
        - attributes
      title: AchievementRestoreData
      type: object
    JsonApiResource_AchievementEarnAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/AchievementEarnAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[AchievementEarnAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    AchievementRestoreAttributes:
      description: |-
        Attributes accepted when restoring a previously revoked earn.

        achievement_id/hub_id/contact_id are NOT here — all three are already in
        the URL path (POST .../achievements/{achievement_id}/restore).
      properties:
        restore_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Restore Reason
      title: AchievementRestoreAttributes
      type: object
    AchievementEarnAttributes:
      description: Wire-shape attributes for an achievement_earns resource.
      properties:
        achievement_id:
          title: Achievement Id
          type: string
        award_reason:
          title: Award Reason
          type: string
        contact_id:
          title: Contact Id
          type: string
        earned_at:
          format: date-time
          title: Earned At
          type: string
        hub_id:
          title: Hub Id
          type: string
        points_awarded:
          title: Points Awarded
          type: integer
        restored_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Restored At
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Revoked At
        source:
          title: Source
          type: string
      required:
        - achievement_id
        - hub_id
        - contact_id
        - source
        - award_reason
        - points_awarded
        - earned_at
      title: AchievementEarnAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````