> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/ja/rissu/api-docs/authentication.md).

# 認証

Rememberizerは、ユーザーアカウントとセッションを管理するためのいくつかの認証エンドポイントを提供します。この文書では、利用可能な認証APIについて説明します。

## サインアップ

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/auth/signup/" method="post" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

### 例リクエスト

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signup/ \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "secure_password",
    "name": "ジョン・ドー",
    "captcha": "recaptcha_response"
  }'
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const signUp = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/signup/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: 'user@example.com',
      password: 'secure_password',
      name: 'ジョン・ドー',
      captcha: 'recaptcha_response'
    })
  });
  
  const data = await response.json();
  console.log(data);
};

signUp();
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def sign_up():
    headers = {
        "Content-Type": "application/json"
    }
    
    payload = {
        "email": "user@example.com",
        "password": "secure_password",
        "name": "ジョン・ドー",
        "captcha": "recaptcha_response"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/signup/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

sign_up()
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}
{% endtabs %}

## サインイン

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/auth/signin/" method="post" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

### 例リクエスト

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signin/ \
  -H "Content-Type: application/json" \
  -d '{
    "login": "user@example.com",
    "password": "secure_password",
    "captcha": "recaptcha_response"
  }'
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const signIn = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/signin/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      login: 'user@example.com',
      password: 'secure_password',
      captcha: 'recaptcha_response'
    })
  });
  
  // 応答に認証クッキーがあるか確認
  if (response.status === 204) {
    console.log("ログイン成功！");
  } else {
    console.error("ログイン失敗！");
  }
};

signIn();
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def sign_in():
    headers = {
        "Content-Type": "application/json"
    }
    
    payload = {
        "login": "user@example.com",
        "password": "secure_password",
        "captcha": "recaptcha_response"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/signin/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 204:
        print("ログイン成功！")
    else:
        print("ログイン失敗！")

sign_in()
```

{% hint style="info" %}
`recaptcha_response` を実際の reCAPTCHA 応答に置き換えてください。
{% endhint %}
{% endtab %}
{% endtabs %}

## メール確認

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/auth/verify-email/" method="post" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

### 例リクエスト

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/verify-email/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "verification_code": "123456"
  }'
```

{% hint style="info" %}
`YOUR_JWT_TOKEN` を実際のJWTトークンに置き換え、あなたのメールに送信された確認コードを使用してください。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const verifyEmail = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/verify-email/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      verification_code: '123456'
    })
  });
  
  if (response.status === 200) {
    console.log("メール確認に成功しました！");
  } else {
    console.error("メール確認に失敗しました！");
  }
};

verifyEmail();
```

{% hint style="info" %}
`YOUR_JWT_TOKEN` を実際のJWTトークンに置き換え、あなたのメールに送信された確認コードを使用してください。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def verify_email():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "verification_code": "123456"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/verify-email/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 200:
        print("メール確認に成功しました！")
    else:
        print("メール確認に失敗しました！")

verify_email()
```

{% hint style="info" %}
`YOUR_JWT_TOKEN` を実際のJWTトークンに置き換え、あなたのメールに送信された確認コードを使用してください。
{% endhint %}
{% endtab %}
{% endtabs %}

## トークン管理

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/auth/custom-refresh/" method="post" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

### 例のリクエスト

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-refresh/ \
  -b "refresh_token=YOUR_REFRESH_TOKEN"
```

{% hint style="info" %}
このエンドポイントは認証のためにクッキーを使用します。リフレッシュトークンはクッキーとして送信する必要があります。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const refreshToken = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-refresh/', {
    method: 'POST',
    credentials: 'include' // これによりリクエストにクッキーが含まれます
  });
  
  if (response.status === 204) {
    console.log("トークンが正常に更新されました！");
  } else {
    console.error("トークンの更新に失敗しました！");
  }
};

refreshToken();
```

{% hint style="info" %}
このエンドポイントは認証のためにクッキーを使用します。アプリケーションがリクエストに資格情報を含めていることを確認してください。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def refresh_token():
    cookies = {
        "refresh_token": "YOUR_REFRESH_TOKEN"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/custom-refresh/",
        cookies=cookies
    )
    
    if response.status_code == 204:
        print("トークンが正常に更新されました！")
    else:
        print("トークンの更新に失敗しました！")

refresh_token()
```

{% hint style="info" %}
`YOUR_REFRESH_TOKEN`を実際のリフレッシュトークンに置き換えてください。
{% endhint %}
{% endtab %}
{% endtabs %}

## ログアウト

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/auth/custom-logout/" method="post" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

### 例のリクエスト

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-logout/
```

{% hint style="info" %}
このエンドポイントは認証クッキーをクリアします。
{% endhint %}

```javascript
const logout = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-logout/', {
    method: 'POST',
    credentials: 'include' // これによりリクエストにクッキーが含まれます
  });
  
  if (response.status === 204) {
    console.log("ログアウト成功！");
  } else {
    console.error("ログアウト失敗！");
  }
};

logout();
```

{% hint style="info" %}
このエンドポイントは認証のためにクッキーを使用します。アプリケーションがリクエストに資格情報を含めることを確認してください。
{% endhint %}

```python
import requests

def logout():
    session = requests.Session()
    
    response = session.post(
        "https://api.rememberizer.ai/api/v1/auth/custom-logout/"
    )
    
    if response.status_code == 204:
        print("ログアウト成功！")
    else:
        print("ログアウト失敗！")

logout()
```

{% hint style="info" %}
このエンドポイントは認証クッキーをクリアします。
{% endhint %}

{% endtabs %


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.rememberizer.ai/ja/rissu/api-docs/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
