REST 로그아웃 API

REST API 세션 로그아웃 처리 API입니다.

API Endpoint

DELETE/v1/rest/auth
Cookie Auth RequiredResponse: */*

API 한눈에 보기

구현 전에 확인할 요청/응답 규모와 코드값 힌트입니다.

Samples included

Request Fields

0

Required Fields

0

Response Fields

4

Available Code Samples

cURL / fetch / Response

인증 후 Cookie: accessToken=발급받은_토큰값 헤더가 필요합니다.

구현 체크리스트 (Implementation Checklist)

요청 헤더에 Cookie: accessToken=발급받은_토큰값을 포함합니다.

Content-Type과 lang 헤더를 실제 운영 환경에서도 동일하게 전달합니다.

운영 확인 항목

!요청 시각, path, HTTP status, errorCode를 로그에 보관합니다.

!개인정보 필드는 로그와 실패 알림에서 완벽히 마스킹 처리합니다.

!4xx 에러는 요청 데이터 자가 보정, 5xx 에러는 임시 지수 백오프 적용 대상으로 삼습니다.

Response

4 fields

success

boolean

API 성공 여부

exampletrue

message

string

전달 메세지

exampleAPI가 정상 처리되었습니다

errorCode

number

int32

에러 코드

example0

data

OBJECT

전달 데이터

example{}

예시 코드 및 샘플

같은 요청을 cURL, JavaScript fetch, JSON 샘플로 확인할 수 있습니다.

curl -X DELETE "$BASE_URL/v1/rest/auth" \
  -H "lang: ko" \
  -H "Cookie: accessToken=발급받은_토큰값"
const response = await fetch(`${BASE_URL}/v1/rest/auth`, {
  "method": "DELETE",
  "headers": {
    "lang": "ko",
    "Cookie": "accessToken=발급받은_토큰값"
  }
});

if (!response.ok) {
  const error = await response.json();
  throw new Error(`ASAP API error: ${response.status} ${error.message ?? ''}`);
}

const data = await response.json();
{
  "success": true,
  "message": "API가 정상 처리되었습니다",
  "errorCode": 0,
  "data": {}
}