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

# 게시물 생성 및 편집

> 인증된 사용자에 대해 새 게시물을 생성하거나, edit_options가 제공된 경우 기존 게시물을 수정합니다.



## OpenAPI

````yaml /ko/openapi.json POST /2/tweets
openapi: 3.0.0
info:
  description: X API v2에서 사용 가능한 엔드포인트
  version: '2.157'
  title: X API v2
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
  - description: X API
    url: https://api.x.com
security: []
tags:
  - name: Account Activity
    description: AAA 구독을 조회하고 관리하는 엔드포인트입니다.
    externalDocs:
      description: 자세히 알아보기
      url: >-
        https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity
  - name: Bookmarks
    description: 사용자 북마크를 조회하고 관리하기 위한 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/bookmarks
  - name: Compliance
    description: 시스템 내 X 데이터를 규정 준수 상태로 유지하기 위한 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: >-
        https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction
  - name: Connections
    description: 스트리밍 연결을 위한 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.x.com/en/docs/x-api/connections
  - name: Direct Messages
    description: Direct Messages(다이렉트 메시지)를 조회하고 관리하기 위한 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/direct-messages
  - name: General
    description: 일반적인 API 기능을 위한 기타 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api
  - name: Lists
    description: 리스트를 조회하고 관리하는 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/lists
  - name: Media
    description: 미디어 관련 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.x.com
  - name: MediaUpload
    description: 미디어 업로드 관련 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.x.com
  - name: News
    description: 뉴스 스토리를 조회하는 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/news
  - name: Spaces
    description: Spaces를 조회하고 관리하는 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/spaces
  - name: Stream
    description: 스트리밍 관련 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.x.com
  - name: Tweets
    description: Tweet 조회, 검색 및 수정과 관련된 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/tweets/lookup
  - name: Users
    description: 사용자 관계 조회 및 관리를 위한 엔드포인트
    externalDocs:
      description: 자세히 알아보기
      url: https://developer.twitter.com/en/docs/twitter-api/users/lookup
paths:
  /2/tweets:
    post:
      tags:
        - Tweets
      summary: 게시물 생성 및 편집
      description: 인증된 사용자에 대해 새 게시물을 생성하거나, edit_options가 제공된 경우 기존 게시물을 수정합니다.
      operationId: createPosts
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TweetCreateRequest'
        required: true
      responses:
        '201':
          description: 요청이 성공했습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TweetCreateResponse'
        default:
          description: 요청이 실패했습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - OAuth2UserToken:
            - tweet.read
            - tweet.write
            - users.read
        - UserToken: []
      externalDocs:
        url: >-
          https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets
components:
  schemas:
    TweetCreateRequest:
      type: object
      properties:
        card_uri:
          type: string
          description: >-
            Card URI 매개변수입니다. Quote Tweet id, 투표(Poll), 미디어(Media), 다이렉트 메시지 딥
            링크와는 상호 배타적입니다.
        community_id:
          $ref: '#/components/schemas/CommunityId'
        direct_message_deep_link:
          type: string
          description: 공개 타임라인 상의 대화를 다이렉트 메시지로 전환하기 위한 링크입니다.
        edit_options:
          type: object
          description: 기존 게시물을 수정할 때 사용하는 옵션입니다. 이 값이 제공되면 새 게시물을 생성하지 않고 지정된 게시물을 수정합니다.
          required:
            - previous_post_id
          properties:
            previous_post_id:
              $ref: '#/components/schemas/TweetId'
          additionalProperties: false
        for_super_followers_only:
          type: boolean
          description: 슈퍼 팔로워에게만 공개되는 Tweet입니다.
          default: false
        geo:
          type: object
          description: 지리적 위치 정보를 지정하기 위해 Tweet에 첨부될 Place id입니다.
          properties:
            place_id:
              type: string
          additionalProperties: false
        media:
          type: object
          description: >-
            생성된 Tweet에 첨부되는 미디어 정보입니다. 이는 Quote Tweet id, 투표, Card URI와 서로
            배타적입니다.
          required:
            - media_ids
          properties:
            media_ids:
              type: array
              description: 생성된 Tweet에 첨부할 미디어 id 목록입니다.
              minItems: 1
              maxItems: 4
              items:
                $ref: '#/components/schemas/MediaId'
            tagged_user_ids:
              type: array
              description: 생성된 Tweet의 미디어에 태그할 사용자 id 목록입니다.
              minItems: 0
              maxItems: 10
              items:
                $ref: '#/components/schemas/UserId'
          additionalProperties: false
        nullcast:
          type: boolean
          description: 널캐스트(프로모션 전용) 포스트는 공개 타임라인에 표시되지 않으며 팔로워에게도 노출되지 않습니다.
          default: false
        poll:
          type: object
          description: >-
            설문이 포함된 Tweet의 설문 옵션입니다. Media, Quote Tweet id, Card URI와는 서로
            배타적입니다.
          required:
            - options
            - duration_minutes
          properties:
            duration_minutes:
              type: integer
              description: 설문의 지속 시간(분 단위)입니다.
              minimum: 5
              maximum: 10080
              format: int32
            options:
              type: array
              minItems: 2
              maxItems: 4
              items:
                type: string
                description: 설문 선택지의 텍스트입니다.
                minLength: 1
                maxLength: 25
            reply_settings:
              type: string
              description: 해당 Tweet에 누가 답글을 달 수 있는지를 지정하는 설정입니다.
              enum:
                - following
                - mentionedUsers
                - subscribers
                - verified
          additionalProperties: false
        quote_tweet_id:
          $ref: '#/components/schemas/TweetId'
        reply:
          type: object
          description: 답글 대상이 되는 Tweet에 대한 정보입니다.
          required:
            - in_reply_to_tweet_id
          properties:
            auto_populate_reply_metadata:
              type: boolean
              description: true로 설정하면 답글 메타데이터가 자동으로 채워집니다.
            exclude_reply_user_ids:
              type: array
              description: 답글에서 제외할 사용자 id 목록입니다.
              items:
                $ref: '#/components/schemas/UserId'
            in_reply_to_tweet_id:
              $ref: '#/components/schemas/TweetId'
          additionalProperties: false
        reply_settings:
          type: string
          description: 누가 이 Tweet에 답글을 달 수 있는지를 나타내는 설정입니다.
          enum:
            - following
            - mentionedUsers
            - subscribers
            - verified
        share_with_followers:
          type: boolean
          description: 커뮤니티 게시물을 팔로워에게도 공유합니다.
          default: false
        text:
          $ref: '#/components/schemas/TweetText'
      additionalProperties: false
    TweetCreateResponse:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - text
          properties:
            id:
              $ref: '#/components/schemas/TweetId'
            text:
              $ref: '#/components/schemas/TweetText'
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Problem'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    Problem:
      type: object
      description: >-
        IETF RFC 7807(https://tools.ietf.org/html/rfc7807)에 정의된 HTTP Problem
        Details 객체
      required:
        - type
        - title
      properties:
        detail:
          type: string
        status:
          type: integer
        title:
          type: string
        type:
          type: string
      discriminator:
        propertyName: type
        mapping:
          about:blank:
            $ref: '#/components/schemas/GenericProblem'
          https://api.twitter.com/2/problems/client-disconnected:
            $ref: '#/components/schemas/ClientDisconnectedProblem'
          https://api.twitter.com/2/problems/client-forbidden:
            $ref: '#/components/schemas/ClientForbiddenProblem'
          https://api.twitter.com/2/problems/conflict:
            $ref: '#/components/schemas/ConflictProblem'
          https://api.twitter.com/2/problems/disallowed-resource:
            $ref: '#/components/schemas/DisallowedResourceProblem'
          https://api.twitter.com/2/problems/duplicate-rules:
            $ref: '#/components/schemas/DuplicateRuleProblem'
          https://api.twitter.com/2/problems/invalid-request:
            $ref: '#/components/schemas/InvalidRequestProblem'
          https://api.twitter.com/2/problems/invalid-rules:
            $ref: '#/components/schemas/InvalidRuleProblem'
          https://api.twitter.com/2/problems/noncompliant-rules:
            $ref: '#/components/schemas/NonCompliantRulesProblem'
          https://api.twitter.com/2/problems/not-authorized-for-field:
            $ref: '#/components/schemas/FieldUnauthorizedProblem'
          https://api.twitter.com/2/problems/not-authorized-for-resource:
            $ref: '#/components/schemas/ResourceUnauthorizedProblem'
          https://api.twitter.com/2/problems/operational-disconnect:
            $ref: '#/components/schemas/OperationalDisconnectProblem'
          https://api.twitter.com/2/problems/resource-not-found:
            $ref: '#/components/schemas/ResourceNotFoundProblem'
          https://api.twitter.com/2/problems/resource-unavailable:
            $ref: '#/components/schemas/ResourceUnavailableProblem'
          https://api.twitter.com/2/problems/rule-cap:
            $ref: '#/components/schemas/RulesCapProblem'
          https://api.twitter.com/2/problems/streaming-connection:
            $ref: '#/components/schemas/ConnectionExceptionProblem'
          https://api.twitter.com/2/problems/unsupported-authentication:
            $ref: '#/components/schemas/UnsupportedAuthenticationProblem'
          https://api.twitter.com/2/problems/usage-capped:
            $ref: '#/components/schemas/UsageCapExceededProblem'
    CommunityId:
      type: string
      description: 이 커뮤니티의 고유 식별자입니다.
      pattern: ^[0-9]{1,19}$
      example: '1146654567674912769'
    TweetId:
      type: string
      description: >-
        이 Tweet의 고유 식별자입니다. 일부 언어 및 도구에서 큰 정수를 처리하지 못해 발생하는 문제를 피하기 위해 문자열로
        반환됩니다.
      pattern: ^[0-9]{1,19}$
      example: '1346889436626259968'
    MediaId:
      type: string
      description: 이 미디어의 고유 식별자입니다.
      pattern: ^[0-9]{1,19}$
      example: '1146654567674912769'
    UserId:
      type: string
      description: >-
        이 사용자에 대한 고유 식별자입니다. 일부 언어나 도구에서 큰 정수를 제대로 처리하지 못하는 문제를 피하기 위해 문자열로
        반환됩니다.
      pattern: ^[0-9]{1,19}$
      example: '2244994945'
    TweetText:
      type: string
      description: Tweet의 콘텐츠입니다.
      example: >-
        Learn how to use the user Tweet timeline and user mention timeline
        endpoints in the X API v2 to explore Tweet\u2026
        https:\/\/t.co\/56a0vZUx7i
    GenericProblem:
      description: HTTP 상태 코드가 제공하는 정보 외에는 추가 정보가 없는 일반적인 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    ClientDisconnectedProblem:
      description: 클라이언트의 연결이 끊어졌습니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    ClientForbiddenProblem:
      description: 클라이언트가 이 요청을 보내는 것이 금지되어 있음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            reason:
              type: string
              enum:
                - official-client-forbidden
                - client-not-enrolled
            registration_url:
              type: string
              format: uri
    ConflictProblem:
      description: 이미 진행 중인 작업이 있는 경우 새 작업을 생성할 수 없습니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    DisallowedResourceProblem:
      description: 요청된 리소스가 이 API의 원칙을 위반했음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - resource_id
            - resource_type
            - section
          properties:
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
    DuplicateRuleProblem:
      description: 제출한 규칙이 기존 규칙과 중복됩니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            id:
              type: string
            value:
              type: string
    InvalidRequestProblem:
      description: 이 요청이 유효하지 않음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            errors:
              type: array
              minItems: 1
              items:
                type: object
                properties:
                  message:
                    type: string
                  parameters:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
    InvalidRuleProblem:
      description: 제출한 규칙이 유효하지 않습니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    NonCompliantRulesProblem:
      description: 사용자의 규칙 집합이 준수되지 않았음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    FieldUnauthorizedProblem:
      description: 특정 Tweet이나 사용자 등의 필드에 접근할 수 없음을 나타냅니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - resource_type
            - field
            - section
          properties:
            field:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
    ResourceUnauthorizedProblem:
      description: 특정 Tweet, User 등을 조회할 수 없음을 의미하는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - value
            - resource_id
            - resource_type
            - section
            - parameter
          properties:
            parameter:
              type: string
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
            value:
              type: string
    OperationalDisconnectProblem:
      description: 운영상의 이유로 연결이 해제되었습니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            disconnect_type:
              type: string
              enum:
                - OperationalDisconnect
                - UpstreamOperationalDisconnect
                - ForceDisconnect
                - UpstreamUncleanDisconnect
                - SlowReader
                - InternalError
                - ClientApplicationStateDegraded
                - InvalidRules
    ResourceNotFoundProblem:
      description: 지정된 Tweet이나 사용자가 존재하지 않음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - parameter
            - value
            - resource_id
            - resource_type
          properties:
            parameter:
              type: string
              minLength: 1
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            value:
              type: string
              description: 값은 해당 필드의 스키마를 따릅니다.
    ResourceUnavailableProblem:
      description: 특정 Tweet, User 등이 사용자에게 제공되지 않음을 의미하는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - parameter
            - resource_id
            - resource_type
          properties:
            parameter:
              type: string
              minLength: 1
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
    RulesCapProblem:
      description: 허용된 최대 규칙 개수를 초과했습니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    ConnectionExceptionProblem:
      description: 연결 관련 문제를 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            connection_issue:
              type: string
              enum:
                - TooManyConnections
                - ProvisioningSubscription
                - RuleConfigurationIssue
                - RulesInvalidIssue
    UnsupportedAuthenticationProblem:
      description: 사용된 인증 방식이 지원되지 않을 때의 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
    UsageCapExceededProblem:
      description: 사용량 한도를 초과했음을 나타내는 Problem입니다.
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            period:
              type: string
              enum:
                - Daily
                - Monthly
            scope:
              type: string
              enum:
                - Account
                - Product
  securitySchemes:
    OAuth2UserToken:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.x.com/2/oauth2/authorize
          tokenUrl: https://api.x.com/2/oauth2/token
          scopes:
            block.read: View accounts you have blocked.
            bookmark.read: Read your bookmarked Posts.
            bookmark.write: Create and delete your bookmarks.
            dm.read: Read all your Direct Messages.
            dm.write: Send and manage your Direct Messages.
            follows.read: View accounts you follow and accounts following you.
            follows.write: Follow and unfollow accounts on your behalf.
            like.read: View Posts you have liked and likes you can see.
            like.write: Like and unlike Posts on your behalf.
            list.read: >-
              View Lists, members, and followers of Lists you created or are a
              member of, including private Lists.
            list.write: Create and manage Lists on your behalf.
            media.write: Upload media, such as photos and videos, on your behalf.
            mute.read: View accounts you have muted.
            mute.write: Mute and unmute accounts on your behalf.
            offline.access: Request a refresh token for the app.
            space.read: View all Spaces you have access to.
            timeline.read: >-
              View all Custom Timelines you can see, including public Custom
              Timelines from other developers.
            tweet.moderate.write: Hide and unhide replies to your Posts.
            tweet.read: >-
              View all Posts you can see, including those from protected
              accounts.
            tweet.write: Post and repost on your behalf.
            users.read: View any account you can see, including protected accounts.
    UserToken:
      type: http
      scheme: OAuth

````