> For the complete documentation index, see [llms.txt](https://iammeosjin.gitbook.io/authefy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iammeosjin.gitbook.io/authefy/master.md).

# Authefy GraphQL API

## Schema

{% file src="/files/-Mb9LOWQfYE8jWu3ZuAl" %}
authefy.graphql
{% endfile %}

## Internal API Flow

#### Admin registers in Authefy GraphQL API with their email

```graphql
mutation {
  createAdmin(input:{
    username:"hov@email.com"
    password:"8b7b748af874504b98d263e8d070fec3"
  }) {
    id
    username
    type
    isEmailVerified
  }
}
```

#### Admin verifies their email

![Click the link and it will verify the admin's email](/files/-Mb9FuMuyyxkRlDjg_eP)

#### Admin creates a new application

```graphql
mutation {
  createApplication(input:{
    name:"Demo Application" #name of application
    domainName:"https://demo-app.ph" #(optional) home url of the application
    webhookURI: "https://demo-app.ph/hook" #(optional) router where Authefy will send user events 
    requireEmailVerification: true #(optional) send email verification to application users after regisration
    redirectionURIAfterEmailVerification: "https://demo-app.ph/home" #(optional) landing page where the user will be redirected after verifying their email
    usernameFormat: EMAIL #(optional) force users to use formatted usernames. by default, user can register any string as username
  }) {
    id
    name
    domainName
    webhookURI
    accessKeys
    usernameFormat
    requireEmailVerification
    redirectionURIAfterEmailVerification
  }
}
```

#### Admin generates a new application access key

```graphql
mutation {
  generateApplicationAccessKey(id: "application-id")
  # returns an access-key
}
```
