Which curves are boundary of pseudoholomorphic curves? I have posted it on Mathstackexchange but nobody replied. 
Consider a loop $\gamma:\mathbb{S}^1\to M^{2n}$ in a symplectic manifold $(M^{2n},\omega)$. Let $J$ be an $\omega$-compatible almost complex structure on $M$.
My naive question is: when does $\gamma$ bound a pseudoholomorphic curve?  More precisely,

when there does exists  a Riemann surface with boundary $\Sigma$, and a J-holomorphic map $u:\Sigma\to (M,J)$ such that $u|_{\partial \Sigma} \equiv \gamma$ ?

I do not  know much about pseudoholomorhic curves, I see that some people requires some conditions on the boundary like, contact type or totally real, if you want you can consider these assumptions or deal with these cases. 
 A: The 'moment conditions' that Ben McKay mentions are simply this:  A closed curve $C$ in $\mathbb{C}^n$ bounds a compact Riemann surface (which might be singular) if and only if the integral around $C$ of any global holomorphic $1$-form on $\mathbb{C}^n$ vanishes.
One direction is just Stokes' Theorem:  If $\omega$ is a holomorphic $1$-form, then $\mathrm{d}\omega$ is a holomorphic $2$-form, and a holomorphic $2$-form vanishes when pulled back to any (possibly singular) complex curve.  Thus, if $C = \partial X$ where $X\subset\mathbb{C}^n$ is a compact Riemann surface (with boundary), then $\int_C\omega = \int_X\mathrm{d}\omega = 0$.
The converse, which (I think) is due to Harvey and Lawson (Boundaries of complex analytic varieties, I., Annals of Mathematics 102 (1975), 223–290), is rather deeper.  
I don't remember whether there is a test for when $C$ bounds an actual holomorphic disk (i.e., a Riemann surface of genus $0$).  I believe I remember that when $C$ does bound a compact (singular) holomorphic Riemann surface, it bounds only one.  (I don't have access to the Harvey-Lawson paper I cited just now.  If you want the definitive statment, I suggest that you check that paper.)
A: I want to explain why one should not expect that a given generic loop is ever the boundary of a holomorphic curve (unless $\dim M = 2$).  My claim (or my intuition) depends of course on the definition of "generic", so let me try to justify the statement:
Take your loop $\gamma$, then construct a totally real submanifold $L$ that contains $\gamma$.  (If $\gamma$ is embedded the construction of $L$ does not pose any difficulty; and we are not requiring that $L$ is closed or anything similar.)
Assuming now that $\gamma$ bounds a smooth map $f\colon \Sigma \to (M,J)$ for some Riemannian surface $\Sigma$, you can use the Riemann-Roch formula to compute the "expected" dimension of the space of holomorphic curves that are homotopic to $f$.  Assuming that $\gamma$ is injective, and that $J$ is chosen "generically" (which of course is a bit of a mysterious property), you can assume that the expected dimension corresponds to the genuine dimension of the space of holomorphic curves.
If the expected dimension is negative, then there will not be any holomorphic curve bounded by $\gamma$ in this homotopy class.
(Note that morally the higher the genus of the surface the more negative the dimension! For example, if $S_1,S_2$ are closed Riemann surfaces and the genus of $S_2$ is $\ge 2$, then the expected dimension of a holomorphic curve
in $S_1\times S_2$ that is homotopic to $\{p\}\times S_2$ is negative.  Obviously
if we take the product almost complex structure of $S_1\times S_2$ then the manifold will be foliated by the holomorphic curves $\{p\}\times S_2$, which seems to be a contradiction to what I wrote, but this is because the almost complex structure $j_1\oplus j_2$ is highly non-generic ... as soon as you slightly perturb it, no holomorphic curves in that homotopy class will survive.)
Note that up to here, we have not used that $M$ is symplectic, but only that it is almost complex!
The Riemann-Roch formula is
$$ \operatorname{index \bar \partial_J} = \frac{1}{2}\dim M \cdot \chi(\Sigma) + \mu (f^*TM, f^*TL) , $$
where $\chi(\Sigma)$ is the Euler class of $\Sigma$ and $\mu(f^*TM, f^*TL)$ is the Maslov index of $f$ with respect to $L$ which measures by how much $TL$ "turns" along $\gamma$ with respect to the trivialization of the complex bundle $f^*(TM,J)$.
In order for a generic $J$ to admit any holomorphic curve with boundary $\gamma$ it follows that the Maslov class $\mu(f^*TM, f^*TL)$ of the homotopy class of the potential holomorphic curve has to be large enough so that the Fredholm index is positive.  For a chosen totally real submanifold $L$ there might thus exist certain homotopy classes that can be represented by holomorphic curves with boundary on $L$, but in the initial question you were not at all interested in a specific $L$ only in $\gamma$!
We can instead choose a countable family of totally real submanifolds $L_k$ such that for any smooth $f\colon (\Sigma, \partial \Sigma) \to (M, \gamma)$ we find an $L_k$ in this family such that the index of $f$ with respect to this $L_k$ will be negative (except of course, when $\dim M = 2$, because in this case $L = \gamma$ without choice).
We can then choose an almost complex structure $J$ close to the initial one that is regular for all of the countably many totally real submanifolds $L_k$ simultaneously. For this generic $J$ there is no holomorphic curve with boundary in $L_k$ that has negative index (with respect to this $L_k$).  But this means that there is no holomorphic curve at all bounded by $\gamma$.
This proves that in a certain sense there is never a holomorphic curve with boundary $\gamma$ except for extremely special choices of $\gamma$ and $J$ (this of course is all modulo "genericity" of the almost complex structure, which is not a very user-friendly definition, because you can never check if "your" $J$ is actually "generic". But this is the way that symplectic topology goes...).
