api.gouv.fr Users API

User related operations

GitHub OpenAPI

Operations 13

GET /users/ List all users #
POST /users/ Create a new user #
GET /users/roles/ List all possible user roles #
GET /users/suggest/ Suggest users #
DELETE /users/{id}/followers/ Unfollow an object given its ID #
GET /users/{id}/followers/ List all followers for a given object #
POST /users/{id}/followers/ Follow a user given its ID #
DELETE /users/{user}/ Delete a user given its identifier #
GET /users/{user}/ Get a user given its identifier #
PUT /users/{user}/ Update a user given its identifier #
POST /users/{user}/avatar/ Upload a new avatar for a given user #
GET /users/{user}/contacts/ List all user contact points #
POST /users/{user}/rotate_password/ Force a password rotation on the user's next login and reset their current… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-gouv-fr:api-gouv-fr-users-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-gouv-fr-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: uData API
  title: uData Users API
  version: '1.0'
servers:
- url: https://www.data.gouv.fr/api/1
tags:
- description: User related operations
  name: Users
paths:
  /users/:
    get:
      operationId: list_users
      parameters:
      - description: The search query
        in: query
        name: q
        schema:
          type: string
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
          enum:
          - last_name
          - first_name
          - datasets
          - reuses
          - followers
          - views
          - created
          - -last_name
          - -first_name
          - -datasets
          - -reuses
          - -followers
          - -views
          - -created
      - description: The page to fetch
        in: query
        name: page
        schema:
          type: integer
          default: 1
          exclusiveMinimum: 0
      - description: The page size to fetch
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
          exclusiveMinimum: 0
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPage'
      summary: List all users
      tags:
      - Users
    post:
      operationId: create_user
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User%20%28read%29'
        '400':
          description: Validation error
      summary: Create a new user
      tags:
      - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User%20%28write%29'
        required: true
  /users/roles/:
    get:
      operationId: user_roles
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/UserRole'
                type: array
      summary: List all possible user roles
      tags:
      - Users
  /users/suggest/:
    get:
      operationId: suggest_users
      parameters:
      - description: The string to autocomplete/suggest
        in: query
        name: q
        required: true
        schema:
          type: string
      - description: The amount of suggestion to fetch (between 1 and 20)
        in: query
        name: size
        schema:
          type: string
          default: 10
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/UserSuggestion'
                type: array
      summary: Suggest users
      tags:
      - Users
  /users/{id}/followers/:
    parameters:
    - in: path
      name: id
      required: true
      schema:
        type: string
    delete:
      description: Returns the number of followers left after the operation
      operationId: unfollow_user
      responses:
        '200':
          description: Success
      summary: Unfollow an object given its ID
      tags:
      - Users
    get:
      operationId: list_user_followers
      parameters:
      - description: The page to fetch
        in: query
        name: page
        schema:
          type: integer
          default: 1
          exclusiveMinimum: 0
      - description: The page size to fetch
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
          exclusiveMinimum: 0
      - description: Filter follower by user, it allows to check if a user is following the object
        in: query
        name: user
        schema:
          type: string
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FollowPage'
      summary: List all followers for a given object
      tags:
      - Users
    post:
      operationId: follow_user
      responses:
        '403':
          description: When trying to follow yourself
      summary: Follow a user given its ID
      tags:
      - Users
  /users/{user}/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    delete:
      operationId: delete_user
      parameters:
      - description: Send formal legal notice with appeal information to owner (admin only)
        in: query
        name: send_legal_notice
        schema:
          type: boolean
          default: false
      - description: 'Do not send the simple deletion notification email. Note: automatically set to True when send_legal_notice=True to avoid sending duplicate emails.'
        in: query
        name: no_mail
        schema:
          type: boolean
          default: false
      - description: Delete comments posted by the user upon user deletion
        in: query
        name: delete_comments
        schema:
          type: boolean
          default: false
      responses:
        '204':
          description: Object deleted
        '403':
          description: When trying to delete yourself
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Delete a user given its identifier
      tags:
      - Users
    get:
      operationId: get_user
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User%20%28read%29'
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Get a user given its identifier
      tags:
      - Users
    put:
      operationId: update_user
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User%20%28read%29'
        '400':
          description: Validation error
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Update a user given its identifier
      tags:
      - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User%20%28write%29'
        required: true
  /users/{user}/avatar/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    post:
      operationId: user_avatar
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedImage'
      summary: Upload a new avatar for a given user
      tags:
      - Users
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: The image to upload
                  format: binary
                bbox:
                  type: string
                  description: An optional crop box, as `left,upper,right,lower` pixel coordinates
              required:
              - file
  /users/{user}/contacts/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    get:
      operationId: get_user_contact_point
      parameters:
      - description: The page to fetch
        in: query
        name: page
        schema:
          type: integer
          default: 1
          exclusiveMinimum: 0
      - description: The page size to fetch
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
          exclusiveMinimum: 0
      - in: query
        name: owner
        schema:
          type: string
      - in: query
        name: organization
        schema:
          type: string
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactPointPage'
      summary: List all user contact points
      tags:
      - Users
  /users/{user}/rotate_password/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    post:
      operationId: rotate_user_password
      responses:
        '204':
          description: Password rotation requested
        '404':
          description: User not found
      summary: Force a password rotation on the user's next login and reset their current…
      tags:
      - Users
components:
  schemas:
    OrganizationReference:
      allOf:
      - $ref: '#/components/schemas/BaseReference'
      - properties:
          acronym:
            maxLength: 128
            type: string
          badges:
            items:
              allOf:
              - $ref: '#/components/schemas/Badge__read'
              readOnly: true
            readOnly: true
            type: array
          logo:
            description: URL of the image
            readOnly: true
            type: string
          logo_thumbnail:
            description: URL of the cropped and squared image (100x100)
            readOnly: true
            type: string
          name:
            type: string
          page:
            description: Link to the udata web page for this organization
            readOnly: true
            type: string
          permissions:
            allOf:
            - $ref: '#/components/schemas/OrganizationPermissions'
            readOnly: true
          slug:
            maxLength: 255
            readOnly: true
            type: string
          uri:
            description: Link to the API endpoint for this organization
            readOnly: true
            type: string
        required:
        - name
        - slug
        type: object
    BaseReference:
      discriminator:
        propertyName: class
      properties:
        class:
          description: The object class
          type: string
        id:
          description: The object unique identifier
          type: string
      required:
      - class
      - id
      type: object
    Follow__read:
      properties:
        follower:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The follower
          readOnly: true
        id:
          readOnly: true
          type: string
        since:
          description: The date from which the user started following
          format: date-time
          readOnly: true
          type: string
      required:
      - follower
      - id
      - since
      type: object
    UserRole:
      properties:
        name:
          description: The role name
          readOnly: true
          type: string
      type: object
    ContactPointPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/ContactPoint__read'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    FollowPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/Follow__read'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    UploadedImage:
      properties:
        image:
          type: string
        success:
          default: true
          description: Whether the upload succeeded or not.
          readOnly: true
          type: boolean
      type: object
    Badge__read:
      properties:
        kind:
          type: string
      required:
      - kind
      type: object
    ContactPoint__read:
      properties:
        contact_form:
          type: string
        email:
          maxLength: 255
          type: string
        id:
          readOnly: true
          type: string
        name:
          maxLength: 255
          type: string
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: Only present if owner is not set. Can only be set to an organization of the current authenticated user.
        owner:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: Only present if organization is not set. Can only be set to the current authenticated user.
        role:
          enum:
          - contact
          - creator
          - publisher
          - rightsHolder
          - custodian
          - distributor
          - originator
          - principalInvestigator
          - processor
          - resourceProvider
          - user
          example: contact
          type: string
      required:
      - id
      - role
      type: object
    User__read:
      properties:
        about:
          format: markdown
          type: string
        active:
          readOnly: true
          type: boolean
        avatar:
          description: URL of the image
          readOnly: true
          type: string
        avatar_thumbnail:
          description: URL of the cropped and squared image (500x500)
          readOnly: true
          type: string
        can_switch_to_proconnect_only:
          description: Whether this session may drop the password and the udata 2FA of the account
          readOnly: true
          type: boolean
        deleted:
          description: The date the account was deleted, null for a live account
          format: date-time
          readOnly: true
          type: string
        email:
          maxLength: 255
          type: string
        first_name:
          maxLength: 255
          type: string
        has_password:
          description: Whether the account can sign in with a password
          readOnly: true
          type: boolean
        has_two_factor:
          description: Whether the account has set up the udata 2FA
          readOnly: true
          type: boolean
        id:
          readOnly: true
          type: string
        last_login_at:
          format: date-time
          readOnly: true
          type: string
        last_name:
          maxLength: 255
          type: string
        mail_cadence:
          enum:
          - immediate
          - daily
          - weekly
          example: immediate
          type: string
        metrics:
          readOnly: true
          type: object
        notifications_paused:
          type: boolean
        organizations:
          description: The organizations the user belongs to
          items:
            $ref: '#/components/schemas/OrganizationReference'
          readOnly: true
          type: array
        page:
          description: Link to the udata web page for this user
          readOnly: true
          type: string
        password_rotation_demanded:
          format: date-time
          readOnly: true
          type: string
        password_rotation_performed:
          format: date-time
          readOnly: true
          type: string
        proconnect:
          allOf:
          - $ref: '#/components/schemas/ProConnectIdentity__read'
          readOnly: true
        roles:
          items:
            readOnly: true
            type: string
          readOnly: true
          type: array
        since:
          format: date-time
          readOnly: true
          type: string
        slug:
          maxLength: 255
          readOnly: true
          type: string
        uri:
          description: Link to the API endpoint for this user
          readOnly: true
          type: string
        website:
          type: string
      required:
      - email
      - first_name
      - id
      - last_name
      - mail_cadence
      - since
      - slug
      type: object
    UserSuggestion:
      properties:
        avatar_url:
          description: The user avatar URL
          readOnly: true
          type: string
        email:
          description: The user email (only the domain for non-admin user)
          readOnly: true
          type: object
        first_name:
          description: The user first name
          readOnly: true
          type: string
        id:
          description: The user identifier
          readOnly: true
          type: string
        last_name:
          description: The user last name
          readOnly: true
          type: string
        slug:
          description: The user permalink string
          readOnly: true
          type: string
      type: object
    UserPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/User__read'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    ProConnectIdentity__read:
      properties:
        second_factor:
          description: Whether the last login with this identity presented a second factor held by the agent (key, passkey, authenticator app)
          type: boolean
        sub:
          description: The ProConnect identifier (`sub`) of the identity
          type: string
        verified_at:
          description: When this identity was trusted as the account holder's, null until then
          format: date-time
          type: string
      required:
      - sub
      type: object
    UserReference:
      allOf:
      - $ref: '#/components/schemas/BaseReference'
      - properties:
          avatar:
            description: URL of the image
            readOnly: true
            type: string
          avatar_thumbnail:
            description: URL of the cropped and squared image (500x500)
            readOnly: true
            type: string
          deleted:
            description: The date the account was deleted, null for a live account
            format: date-time
            readOnly: true
            type: string
          first_name:
            maxLength: 255
            type: string
          last_name:
            maxLength: 255
            type: string
          page:
            description: Link to the udata web page for this user
            readOnly: true
            type: string
          slug:
            maxLength: 255
            readOnly: true
            type: string
          uri:
            description: Link to the API endpoint for this user
            readOnly: true
            type: string
        required:
        - first_name
        - last_name
        - slug
        type: object
    OrganizationPermissions:
      properties:
        delete:
          type: boolean
        edit:
          type: boolean
        harvest:
          type: boolean
        members:
          type: boolean
        private:
          type: boolean
      type: object
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey